You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$250] Attachments - Large image result in attachment not found after being zoomed at first time #76193
Hello @garrettmknight QA team found issue about aspect ratio of image is smaller than expected when zoom in the image a second time. The image is not posible to see , are we need create new issue in this case? or this is consider same root cause with this issue ?
changed the title [-]Attachments - Large image result in attachment not found after being zoomed at first time[/-][+][$250] Attachments - Large image result in attachment not found after being zoomed at first time[/+]on Dec 2, 2025
📣 @mohammadjafarinejad You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖
Summary: Uploading a large image (>7000px in either dimension) and viewing it in the attachment modal causes "Attachment not found" after the upload completes, because the expo-image component retains stale blob URL state when the source transitions to a server URL.
Status: This issue has been fixed and deployed via PR #81631 (merged 2026-02-18). The analysis below documents the root cause and fix for reference.
Root Cause
The bug stems from a state transition race in AttachmentView for high-resolution images (either dimension >7000px):
During upload: The image source is a local blob: URL. Since isHighResolution=true AND isUploaded=false, AttachmentView renders a DefaultAttachmentView placeholder ("Image too large").
Upload completes: The report object populates in Onyx, causing isUploaded to flip to true (via !isEmptyObject(report) in CarouselItem.tsx:101).
Source switch: Now isHighResolution=true AND isUploaded=true, so imageSource switches to previewSource (a server-side resized URL like .1024.jpg) at AttachmentView/index.tsx:327.
Stale cache: Without remounting, the AttachmentViewImage → ImageView → Image → expo-image component chain reuses its internal state. The expo-image component had stale references from the blob URL phase. Combined with the Image component's aggressive memoization (only comparing source reference at Image/index.tsx:181-183), this caused the image load to fail, showing "Attachment not found".
When isHighResolution && isUploaded flips from false to true, the key changes from {id}-full to {id}-preview, forcing React to unmount the old component (clearing stale expo-image cache) and mount a fresh one that properly loads the new server URL.
Note on Scope
This fix only applies to high-resolution images (>7000px). For normal-resolution images, the key prop does not vary based on upload state. If a similar blob-to-server-URL transition issue were to occur for normal images, it would not be covered by this fix, though the rendering path for normal images is different and less susceptible to this race.
Activity
melvin-bot commentedon Nov 27, 2025
Triggered auto assignment to @garrettmknight (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.mitarachim commentedon Nov 27, 2025
Hello @garrettmknight QA team found issue about
aspect ratio of image is smaller than expected when zoom in the image a second time. The image is not posible to see, are we need create new issue in this case? or this is consider same root cause with this issue ?Steps :
Bug7014502_1764209272758.bandicam_2025-11-26_20-42-24-211_-_Trim1.mp4
melvin-bot commentedon Dec 1, 2025
@garrettmknight Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
[-]Attachments - Large image result in attachment not found after being zoomed at first time[/-][+][$250] Attachments - Large image result in attachment not found after being zoomed at first time[/+]melvin-bot commentedon Dec 2, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021995881300252084900
melvin-bot commentedon Dec 2, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @alitoshmatov (
External)97 remaining items
melvin-bot commentedon Mar 11, 2026
Current assignee @garrettmknight is eligible for the Bug assigner, not assigning anyone new.
melvin-bot commentedon Mar 11, 2026
Current assignee @ahmedGaber93 is eligible for the External assigner, not assigning anyone new.
melvin-bot commentedon Mar 11, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022031718775101842607
melvin-bot commentedon Mar 11, 2026
📣 @mohammadjafarinejad You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖
MelvinBot commentedon Mar 11, 2026
🔍 Issue Analysis
Summary: Uploading a large image (>7000px in either dimension) and viewing it in the attachment modal causes "Attachment not found" after the upload completes, because the expo-image component retains stale blob URL state when the source transitions to a server URL.
Status: This issue has been fixed and deployed via PR #81631 (merged 2026-02-18). The analysis below documents the root cause and fix for reference.
Root Cause
The bug stems from a state transition race in
AttachmentViewfor high-resolution images (either dimension >7000px):During upload: The image source is a local
blob:URL. SinceisHighResolution=trueANDisUploaded=false,AttachmentViewrenders aDefaultAttachmentViewplaceholder ("Image too large").Upload completes: The report object populates in Onyx, causing
isUploadedto flip totrue(via!isEmptyObject(report)inCarouselItem.tsx:101).Source switch: Now
isHighResolution=trueANDisUploaded=true, soimageSourceswitches topreviewSource(a server-side resized URL like.1024.jpg) atAttachmentView/index.tsx:327.Stale cache: Without remounting, the
AttachmentViewImage→ImageView→Image→ expo-image component chain reuses its internal state. The expo-image component had stale references from the blob URL phase. Combined with theImagecomponent's aggressive memoization (only comparingsourcereference atImage/index.tsx:181-183), this caused the image load to fail, showing "Attachment not found".Fix Applied (PR #81631)
Added a
keyprop toAttachmentViewImagethat changes when the image transitions from upload to uploaded state:When
isHighResolution && isUploadedflips fromfalsetotrue, the key changes from{id}-fullto{id}-preview, forcing React to unmount the old component (clearing stale expo-image cache) and mount a fresh one that properly loads the new server URL.Note on Scope
This fix only applies to high-resolution images (>7000px). For normal-resolution images, the
keyprop does not vary based on upload state. If a similar blob-to-server-URL transition issue were to occur for normal images, it would not be covered by this fix, though the rendering path for normal images is different and less susceptible to this race.garrettmknight commentedon Mar 11, 2026
@mohammadjafarinejad @aimane-chnaif offers out to you in Upwork. Job here: https://www.upwork.com/ab/applicants/2031718775101842607/hires?filter=aimane&page=1
aimane-chnaif commentedon Mar 11, 2026
@ahmedGaber93's reviewer here. I am not due any payment.
garrettmknight commentedon Mar 11, 2026
Payment Summary
JmillsExpensify commentedon Mar 19, 2026
$250 approved for @ahmedGaber93