-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Fix multiple console errors when login and in onboarding welcome video #46854
Merged
puneetlath
merged 14 commits into
Expensify:main
from
bernhardoj:fix/45619-multiple-console-errors
Aug 8, 2024
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
9616022
fix accessing undefined object
bernhardoj b26c1ef
fix neseted button error
bernhardoj 198e6e9
fix string rendered without <Text> error
bernhardoj 2276e45
fix auto play error because no user interaction and video isn't muted
bernhardoj 5baa0a5
fix play is interrupted by stop
bernhardoj a2cc65f
use then for stopVideo but finally for the rest
bernhardoj b0b0484
added back removed newline
bernhardoj 4ed343b
prettier
bernhardoj 6bd2921
dont reset video player when reportID was previously empty
bernhardoj 91ed245
dont reset video player when reportID was -1
bernhardoj 483c083
Merge branch 'main' into fix/45619-multiple-console-errors
bernhardoj e51f66e
add comment
bernhardoj a0f8339
update comment
bernhardoj ee5be98
prettier
bernhardoj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @bernhardoj it appears that you applied 2 solutions in your proposal or error 7th , didn't you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. The first one waits until the play promise is completed. But on Android mWeb (if I remember the platform correctly), the play is never triggered anymore after the video is stopped. So,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @bernhardoj do you mean the checking
isPlaying
in 1st option is not useful in Android mWeb? Or does it never returnisPlaying
status in Android mWeb?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, at this line only (not this error log), we only need to check
!currentReportID || currentReportID === '-1'
is enough, what do you think? And do you think we should make-1
as a constant?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, what I mean is that, when we open the video, the play video is called multiple times.
App/src/components/VideoPlayerContexts/PlaybackContext.tsx
Lines 28 to 36 in 8193c37
And then
resetVideoPlayerData
is also called once. On other platforms, the order of call looks like this:In mWeb Android, it's
play
play
...
reset
[no more call]
But I just retested it and the call order is similar to other platforms too.
Still, we need to prevent the reset to be called, so we need to check for
prevCurrentReportID
too.I don't have a strong opinion about this one. There is -1 and '-1' and we use this everywhere on the app without const. Maybe we can have a new cleanup issue to create the const and replace it everywhere in the app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay cool. Can you leave a comment explaining why we have to check both current and prev, also another comment in line 79? I think it's useful to back-read later.
App/src/components/VideoPlayerContexts/PlaybackContext.tsx
Line 79 in 91ed245
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @bernhardoj