[Odometer] Blob URL loss detection#86023
[Odometer] Blob URL loss detection#86023jakubkalinski0 wants to merge 29 commits intoExpensify:mainfrom
Conversation
…RequestConfirmationListFooter
…ing_from_confirmation' into jakubkalinski0/Odometer_blob_url_loss_detection
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
…ing_from_confirmation' into jakubkalinski0/Odometer_blob_url_loss_detection
…: use clearOdometerTransactionState to make complete pre-flight cleanup
…ImagesFailure effect
…atest-ref pattern
…ransactionState to fix failing ESLINT
|
@DylanDylann 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d43fc6c4dc
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
… odometer transaction
…in expired-image and retake-receipt branches
|
🚧 @Julesssss 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! 🧪🧪
|
Explanation of Change
PR #86022 has to be merged before we can go ahead with this one
Blob URLs (
blob://...) live only in browser memory. A page refresh destroys them. Attempting to stitch with expired blobs would fail.Two safeguards are in place:
useRestartOnOdometerImagesFailurehook (mounted onIOURequestStepDistanceOdometer): on mount, callscheckIfLocalFileIsAccessiblefor each blob URL stored in the transaction (start image, end image, stitched receipt). If any are unreachable and the request type isDISTANCE_ODOMETER, it clears all odometer data (images, readings, receipt, draft transactions) and navigates back to the start step.OdometerReceiptStitcher.tsx: before callingstitchOdometerImages, the stitching effect re-verifies all local blob URLs. If expired, it clears the transaction and navigates to the start step without ever showing a broken image.Fixed Issues
$ #84707
PROPOSAL: N/A
Tests
We are testing the odometer expense creation flow which you start by doing the following:
Press
FAB-> go to"Track distance"-> choose"Odometer"tab"Replace""Distance"to land on the odometer screen and refresh the browser page"Distance"to land on the odometer screen and tap one of the odometer images to open the image preview"Distance"to land on the odometer screen and tap one of the odometer images to open the image preview and press"Replace"Offline tests
Same as Tests
QA Steps
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
Only web
MacOS: Chrome / Safari
1to16.mov
17to27.mov