Save unsent receipts to the device gallery on sign-out (native)#94327
Save unsent receipts to the device gallery on sign-out (native)#94327adhorodyski wants to merge 4 commits into
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a5e4dd912f
ℹ️ 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".
…ut save getPendingReceiptRequests() missed pending receipts in two ways, both of which let Onyx.clear() delete a local receipt on sign-out without saving it: - REPLACE_RECEIPT queues the raw File object, whose local path lives under `uri` (and name under `name`), not `source`/`localSource`. It was allow-listed but could never match, so every offline receipt-replace was silently dropped. Fall back to `uri` for the path and `name` for the filename. - Other receipt-bearing commands (SEND_MONEY_ELSEWHERE, SEND_MONEY_WITH_WALLET, SHARE_TRACKED_EXPENSE, CATEGORIZE_TRACKED_EXPENSE, ADD_TRACKED_EXPENSE_TO_POLICY) were absent from the allow-list. Add them. Also collapse the repeated string-property guards into a single isRecord-based getString helper. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Closing as well, there's another copy by @rinej |
Explanation of Change
On iOS and Android, if you sign out while a receipt is still uploading, the app now saves that receipt image to your device gallery before it clears storage. That way you can add it again later instead of losing it.
Manual sign-out from Settings shows a short confirmation prompt. Forced sign-outs (expired or invalid session) save silently without a prompt. If saving fails for any reason, sign-out still completes normally.
Fixed Issues
$ #92139
PROPOSAL:
Tests
Unit tests (all passing):
savePendingReceiptsToGalleryTest.ts): verifies correct receipts are picked from the Onyx queueSignInRedirectSaveReceiptsTest.ts: verifies save-before-clear ordering and the fail-safe (sign-out completes even if saving throws)Manual tests still to be done on real devices (not yet verified — marking in QA steps):
Offline tests
N/A
QA Steps
iOS Native and Android Native only (web behavior is unchanged).
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, 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.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