Skip to content

Console Error on [react-native-gesture-handler] when view a video attachment in a report #52157

Closed

Description

@m-natarajan

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.0.57-3
Reproducible in staging?: Needs Reproduction
Reproducible in production?: Needs Reproduction
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @hoangzinh
Slack conversation (hyperlinked to channel name): ts_external_expensify_bugs

Action Performed:

  1. Go to any chat
  2. Send a video attachment
  3. Tap on video attachment in the report

Expected Result:

No console error

Actual Result:

Console error: [react-native-gesture-handler] Some of the callbacks in the gesture are worklets and some are not

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Screen.Recording.2024-11-05.at.07.04.10.mov

View all open jobs on GitHub

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Nov 6, 2024
  2. MelvinBot commented on Nov 6, 2024

    @MelvinBot
    Contributor

    This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

  3. mkzie2 commented on Nov 7, 2024

    @mkzie2
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Console Error on [react-native-gesture-handler] when view a video attachment in a report

    What is the root cause of that problem?

    The issue arises from this gesture callback:

    const pan = Gesture.Pan()
    .onBegin((event) => {
    runOnJS(setIsSliderPressed)(true);
    runOnJS(checkVideoPlaying)(onCheckVideoPlaying);
    runOnJS(pauseVideo)();
    runOnJS(progressBarInteraction)(event);
    })
    .onChange((event) => {
    runOnJS(progressBarInteraction)(event);
    })
    .onFinalize(() => {
    runOnJS(setIsSliderPressed)(false);
    if (!wasVideoPlayingOnCheck.value) {
    return;
    }
    runOnJS(playVideo)();
    });

    In progressBarInteraction, we update a shared value progressWidth which runs in Reanimated context >> progressBarInteraction gets automatically "workletized" (runs in UI thread) then onBegin and onChange callbacks consequently. Only onFinalize does not because it contains plain JS logic.

    So we have 2 workletized and 1 non-workletized callbacks within the same gesture callbacks chain, causing react-native-gesture-handler throwing the error.

    What changes do you think we should make in order to solve the problem?

    Explicitly mark onFinalize callback as worklet by adding 'worklet'; directive at the beginning.

  4. melvin-bot commented on Nov 12, 2024

    @melvin-bot

    Huh... This is 4 days overdue. Who can take care of this?

  5. melvin-bot commented on Nov 14, 2024

    @melvin-bot

    6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  6. mkzie2 commented on Nov 15, 2024

    @mkzie2
    Contributor

    @m-natarajan This has not been assigned any one to take care of.

  7. hoangzinh commented on Nov 15, 2024

    @hoangzinh
    Contributor

    @mkzie2 do you still reproduce this console error on latest main branch?

  8. mkzie2 commented on Nov 15, 2024

    @mkzie2
    Contributor

    @hoangzinh No longer after #51783. We can close this.

  9. hoangzinh commented on Nov 15, 2024

    @hoangzinh
    Contributor

    Thanks for confirmation @mkzie2

    cc @m-natarajan

  10. melvin-bot commented on Nov 18, 2024

    @melvin-bot

    10 days overdue. Is anyone even seeing these? Hello?

  11. melvin-bot commented on Nov 20, 2024

    @melvin-bot

    this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

  12. melvin-bot commented on Nov 20, 2024

    @melvin-bot

    12 days overdue. Walking. Toward. The. Light...

  13. melvin-bot commented on Nov 25, 2024

    @melvin-bot

    This issue has not been updated in over 14 days. eroding to Weekly issue.

  14. melvin-bot commented on Dec 19, 2024

    @melvin-bot

    This issue has not been updated in over 15 days. eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  15. mountiny commented on Dec 19, 2024

    @mountiny
    Contributor

    No longer repro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething is broken. Auto assigns a BugZero manager.Needs ReproductionReproducible steps neededReviewingHas a PR in reviewWeeklyKSv2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions