Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 of 8 tasks
m-natarajan opened this issue Nov 6, 2024 · 15 comments
Closed
2 of 8 tasks
Labels
Bug Something is broken. Auto assigns a BugZero manager. Needs Reproduction Reproducible steps needed Reviewing Has a PR in review Weekly KSv2

Comments

@m-natarajan
Copy link

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] 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

@m-natarajan m-natarajan added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Nov 6, 2024
@MelvinBot
Copy link

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

@mkzie2
Copy link
Contributor

mkzie2 commented Nov 7, 2024

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.

Copy link

melvin-bot bot commented Nov 12, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Nov 12, 2024
Copy link

melvin-bot bot commented Nov 14, 2024

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

@mkzie2
Copy link
Contributor

mkzie2 commented Nov 15, 2024

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

@hoangzinh
Copy link
Contributor

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

@mkzie2
Copy link
Contributor

mkzie2 commented Nov 15, 2024

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

@hoangzinh
Copy link
Contributor

Thanks for confirmation @mkzie2

cc @m-natarajan

Copy link

melvin-bot bot commented Nov 18, 2024

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

Copy link

melvin-bot bot commented Nov 20, 2024

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!

Copy link

melvin-bot bot commented Nov 20, 2024

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

@hoangzinh
Copy link
Contributor

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Nov 25, 2024
Copy link

melvin-bot bot commented Nov 25, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Nov 25, 2024
@melvin-bot melvin-bot bot removed the Weekly KSv2 label Dec 19, 2024
Copy link

melvin-bot bot commented Dec 19, 2024

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!

@melvin-bot melvin-bot bot added the Monthly KSv2 label Dec 19, 2024
@mountiny
Copy link
Contributor

No longer repro

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Monthly KSv2 labels Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Needs Reproduction Reproducible steps needed Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

5 participants