[CP Staging] Fix broken Android upload thumbnail by adding file:// scheme to cached local source - #99546
Conversation
…d local source Co-authored-by: Linh Vo <linhvovan29546@users.noreply.github.com>
Co-authored-by: Linh Vo <linhvovan29546@users.noreply.github.com>
|
I created this PR from an upstream branch since you don't have push access to a fork of 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, or just push directly here if you have write access. |
…ess') Co-authored-by: Linh Vo <linhvovan29546@users.noreply.github.com>
|
Fixed the failing Root cause: Fix: Reworded the three comments to avoid the non-dictionary word (e.g. "stored without a scheme") — comment-only changes, no logic touched. The other red check, Web smoke test (attachment upload)Result: fail (blocked, not a defect). The attach-and-send flow couldn't be driven on web because file uploads are explicitly out of scope for the web testing tooling (the native file-picker can't be interacted with). Worth noting the actual fix here lives in
|
|
No new code fix needed — the previously-failing The only check still showing red is |
|
🤖 Attempted the testing steps on Web — I couldn't complete the image-upload verification on web because the test harness ( Note: the regression this PR fixes is Android-only (iOS/web already tolerate the schemeless local path), so web is a regression-check rather than the primary repro. The Android run for this PR passed all steps. Verifying the web upload preview here would need someone to run it manually (or the harness to expose native file-chooser support, e.g. Playwright
ScreenshotsConcierge 1:1 chat with composer visible before opening actions menu
Chat composer after clicking Add attachment; no file could be selected via agent-device
|
|
@MelvinBot Please add the test step and QA steps for Android/iOS app
|
|
🤖 Added the Tests and QA Steps for Android/iOS native to the PR description, based on the steps you provided:
The QA Steps mirror these and add a regression check that upload previews still render correctly on the remaining platforms (Android: mWeb Chrome, iOS: mWeb Safari, MacOS: Chrome / Safari). Offline tests are set to "Same as Tests". Please review and adjust the wording if you'd like anything different. |
|
@MelvinBot Please make PR ready for review |
|
@linhvovan29546 @NicolasBonet @luacmartins One of you needs to 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] |
|
🤖 Done — marked this PR as Ready for review. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApptelegram-cloud-document-5-6086875545071528333.mp4Android: mWeb ChromeN/A. The PR only applies changes to the native Android/iOS code. iOS: HybridAppScreen.Recording.2026-08-26.at.18.11.12.moviOS: mWeb SafariN/A. The PR only applies changes to the native Android/iOS code. MacOS: Chrome / SafariN/A. The PR only applies changes to the native Android/iOS code. |
|
🚧 Gonals has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
…nailScheme Fix broken Android upload thumbnail by adding file:// scheme to cached local source (cherry picked from commit 3e1ee85) (cherry-picked to staging by lakchote)
|
🚀 Cherry-picked to staging by https://github.com/lakchote in version: 9.4.61-2 🚀
|
|
🤖 No help site changes are required for this PR, so I did not create a docs draft PR. This is a platform-specific bug fix: it prefixes the cached local attachment path with a The help-site articles under |
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.4.61-4 🚀
Bundle Size Analysis (Sentry): |
|
🚀 Cherry-picked to staging by https://github.com/lakchote in version: 9.4.62-1 🚀
|
|
🤖 No help site changes are required for this PR, so I did not create a docs PR. This PR is a purely internal rendering bug fix: it adds a It introduces no new feature, setting, tab, button, or workflow, and doesn't change any user-facing behavior that Expensify's help site ( |
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.4.62-4 🚀
Bundle Size Analysis (Sentry): |






Explanation of Change
On Android, sending an image to a chat showed a broken thumbnail while the attachment uploaded (deploy blocker, regressed in 9.4.59 → 9.4.60).
The optimistic upload preview resolves its source through
getCachedAttachment, which returns the cached local file path stored in Onyx. That path is stored schemeless (e.g./data/user/0/…/cache/attachments/<id>.jpg) so RNFS file operations (exists/unlink) accept it. On Android, React Native's<Image>only loads a local file when it carries afile://scheme — a bare absolute path renders as a broken image (iOS tolerates schemeless paths, which is why this was Android-only).#96531didn't add the schemeless path, but it made the cache write reliably succeed (addedRNFS.mkdirbefore the copy and moved the dir to Caches), so the preview now consistently receives the schemeless cached path where it previously fell back to the originalfile://picked URI.Fix: add the
file://scheme to the value returned to the image renderer, while keeping the stored path schemeless so the RNFS operations still work. This is a minimal roll-forward that leaves the#96531privacy hardening and its migration intact.Fixed Issues
$ #99490
PROPOSAL: #99490 (comment)
Tests
Offline tests
Same as Tests.
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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