Catch AbortError from video.play() on web during rapid seeking#84794
Catch AbortError from video.play() on web during rapid seeking#84794
Conversation
…ors during rapid seeking Co-authored-by: Abdelrahman Khattab <abzokhattab@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
|
Done! This PR has been marked as ready for review. ✅ |
|
@abzokhattab Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-03-11.at.04.21.34.movAndroid: mWeb ChromeScreen.Recording.2026-03-11.at.04.14.48.moviOS: HybridAppScreen.Recording.2026-03-11.at.04.20.27.moviOS: mWeb SafariScreen.Recording.2026-03-11.at.04.19.19.movMacOS: Chrome / SafariScreen.Recording.2026-03-11.at.03.50.48.mov |
|
The PR is ready @Julesssss |
|
@abzokhattab ah conflict to resolve. I can't ask melvin to do this because it will add me as co-auther. |
|
@MelvinBot merge to main and fix the conflicts |
…AbortError Co-authored-by: Abdelrahman Khattab <abzokhattab@users.noreply.github.com> # Conflicts: # patches/expo-video/details.md
The expo-video package was upgraded from 3.0.12 to 55.0.3 on main, removing the old patches directory. This recreates the AbortError catch patch for the new version, adapting to a minor code change in the onplay handler that now includes an if-guard. Co-authored-by: Abdelrahman Khattab <abzokhattab@users.noreply.github.com>
|
@abzokhattab Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
Merged What changed: The Commits:
|
Remove empty first line and fix last hunk line count (7 -> 6) so patch-package can parse the file. Co-authored-by: Abdelrahman Khattab <abzokhattab@users.noreply.github.com>
|
Fixed the failing checks. The patch file
|
The patch file could not be parsed by patch-package 8.1.0-canary.1. Regenerated using git diff --no-index to produce valid hunk headers and correct blob hashes. Also fixed variable shadowing in the onplay handler's catch callback (e -> err) to avoid shadowing the event param. Co-authored-by: Abdelrahman Khattab <abzokhattab@users.noreply.github.com>
|
Fixed the failing checks by regenerating the Root cause: The patch file Fix: Regenerated the patch using |
|
The failing checks were all caused by the The latest CI run shows |
|
@abzokhattab could you verify Melvin's latest change, I'll generate test builds too for final verififcation |
|
🚧 @Julesssss has triggered a test Expensify/App build. You can view the workflow run here. |
|
The failing checks are unrelated to this PR's changes. Failing checks:
Why these are unrelated:
Evidence: All other checks pass (ESLint, typecheck, tests, prettier, spellcheck, perf-tests, storybook, |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
@MelvinBot merge to main again |
…AbortError Co-authored-by: Abdelrahman Khattab <abzokhattab@users.noreply.github.com>
|
Merged |
|
The failing check ( Analysis: This PR only modifies web-only patch files ( Evidence: The two changed files are JavaScript/web-only patches. The iOS build has no compilation errors — only warnings. The build failure is infrastructure-related (cache miss + generic Rock build tool error), not caused by code changes. Suggestion: Re-running the failing check should resolve this. |
|
@MelvinBot merge to main again |
…AbortError Co-authored-by: Abdelrahman Khattab <abzokhattab@users.noreply.github.com>
|
Merged |
|
@Julesssss the issue is fixed Screen.Recording.2026-03-24.at.02.45.53.mov |
Explanation of Change
When playing a video attachment and rapidly seeking via the progress bar, the browser logs
AbortError: The play() request was interrupted by a call to pause(). This happens becauseHTMLVideoElement.play()returns a Promise, and ifpause()is called before it resolves, the browser rejects it with anAbortError.This PR adds a
patch-packagepatch for expo-video'sVideoPlayer.web.jsthat wraps all 5HTMLVideoElement.play()call sites with.catch()to silently swallowAbortErrorwhile re-throwing any other errors. This is the standard fix recommended by Chrome's documentation for this exact error.The 5 patched call sites are:
play()methodreplace()methodreplay()method_synchronizeWithFirstVideo()methodonplayevent listenerFixed Issues
$ #84294
PROPOSAL: #84294 (comment)
Tests
AbortErrorconsole errors appearOffline tests
N/A — This fix only affects web video playback error handling and does not involve network requests.
QA Steps
AbortErrororThe play() request was interruptederrors appearPR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
N/A — web-only patch
Android: mWeb Chrome
N/A — web-only patch
iOS: Native
N/A — web-only patch
iOS: mWeb Safari
N/A — web-only patch
MacOS: Chrome / Safari
N/A — web-only patch (this is where the fix applies)