perf: Skip thumbnail encode on receipt capture - #90670
cristipaval merged 3 commits into
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
🚧 @cristipaval has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
iOS works well! IMG_2313.MP4 |
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
@OlimpiaZurek Could you merge main as well? |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-05-21.at.09.41.39.movAndroid: mWeb ChromeiOS: HybridAppScreen.Recording.2026-05-21.at.09.58.23.moviOS: mWeb SafariMacOS: Chrome / Safari |
|
🚧 @Julesssss has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
Julesssss
left a comment
There was a problem hiding this comment.
Tests well for me on iOS
|
@cristipaval looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
🚧 @cristipaval has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/cristipaval in version: 9.3.79-1 🚀
Bundle Size Analysis (Sentry): |
|
I reviewed the changes in this PR. This is a purely internal performance optimization that:
No user-facing behavior, UI labels, workflows, or features are changed — the receipt capture flow works identically from the user's perspective, just faster. No help site changes are required for this PR. |
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.3.79-4 🚀
|
Explanation of Change
This PR removes the resize/encode step that runs between the camera capture and the navigation to the confirmation screen:
Skip the resize/encode -
pregenerateThumbnailnow callsImage.prefetch(sourceUri)directly instead of running theImageManipulatorresize → encode → save chain. The OS native image pipeline scales the source down at display time, so the confirmation screen still shows a sharp preview without the slow JS-side step. The existing lazy fallback in the same hook (used by gallery upload today) still kicks in if needed.Limit the wait to 150 ms - wrapped the prefetch in a
Promise.raceagainst a 150 ms timer so a stalled prefetch can't block navigation. Includes a.catchso a prefetch rejection resolves cleanly with the source URI rather than bubbling up.Adds a ManualThumbnailGate child span around the wait - so any future regression in this step shows up directly in the Sentry dashboard instead of needing a code-level investigation to spot.
Results (Android dev, real device)
Fixed Issues
$ #91647, #91647
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests
PR 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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari