Repository navigation
Closed
Labels
EngineeringImprovementItem broken or needs improvement.Not a priorityReviewingHas a PR in reviewWeeklyKSv2
Description
Problem
After uploading an image, the app switches from the local file URI to the remote URL. This causes a visible flash — a white thumbnail with a loading spinner appears briefly even though the local and remote images are identical content.
Phase 1 (#65321) stores uploaded attachments locally via libs/actions/Attachment and libs/CacheAPI, but nothing currently uses that cache to serve the image source during or after upload. A hook is needed that checks the local cache first and returns the cached URI when available, preventing the re-fetch flash and enabling offline preview of previously uploaded images.
Open Questions
- Cache quota/eviction: Phase 1 has no quota management. Should this hook handle eviction, or is that a separate concern?
- Redundant caching: VickyStash's web auth-image cache (Add caching for images with authentication on web #84409) overlaps for uploaded images. Should this PR consolidate, or defer?
- Platform scope: Should the hook target all platforms, or just native (since web has a separate caching approach via Add caching for images with authentication on web #84409)?
Solution
???
Linked Issues
- Parent: [Due for payment 2026-04-16] [Image][$1000] Improve NewDot image uploading experience, add large file support #9402
- Phase 1 (caching): (1/2) Implement store/caching for attachments #65321
- Web auth-image caching: Add caching for images with authentication on web #84409 / Fix web image caching authentication issues with expo-image #83112
- Native expo-image caching (resolved): [Due for payment 2026-03-09] [$250] Investigate expo-image caching issues on native mobile #83113
Issue Owner
Current Issue Owner: @NJ-2020Metadata
Metadata
Labels
EngineeringImprovementItem broken or needs improvement.Not a priorityReviewingHas a PR in reviewWeeklyKSv2
Activity
[-]Create hook for displaying local attachment source (image upload phase 2)[/-][+]Improve image uploading experience 2/2[/+]Julesssss commentedon Mar 11, 2026
@NJ-2020 we can use this as a fresh issue for phase 2, please go ahead and update the description with further relevant plans. Or lets discuss!
NJ-2020 commentedon Mar 12, 2026
Quota exceedederror, it could cause inconsistency between remote and local image sources (some cached, some not).⚠️ WarninglikeThis attachment couldn't be cached due to insufficient quota. For uploads, we could block new attachments from being added.expo-imagefrom redundantly caching local files.useCachedImageSource/index.tsfor Web anduseCachedImageSource/index.native.tsfor Native to handle each platform separately?NJ-2020 commentedon Mar 13, 2026
Question (NAB): This PR retrieves the cached source directly inside
Image/BaseImage.tsx, which might cause a brief flash on slower devices — since we're still fetching the local source fromCacheAPIduring rendering. Is that expected?Maybe pre-fetching cached attachments on app/report load — and then use it later when rendering the report action item image, wdyt?
cc: @VickyStash
NJ-2020 commentedon Mar 15, 2026
My plan for the second PR is to add pre-fetching for cached attachments when the app/report loads, ensuring they're ready by render time. Then we'll pass the cached source into
PureReportActionItemvia AttachmentContext and use it during rendering.Also, I'd love to hear your thoughts on this — thanks!
cc: @Julesssss
NJ-2020 commentedon Mar 17, 2026
Update: I am still working on the second PR
Julesssss commentedon Mar 17, 2026
At what point do you think this would be a problem? I imagine this is more of a problem on web?
Yeah I'm not too worried about this yet. Redundancy fix could be a 3rd step IMO.
Makes sense at a high level, though it would be good to look further into the seperate implementations.
VickyStash commentedon Mar 20, 2026
I was thinking about that, but the only doubt I had was the memory usage if we pre-fetch everything from cache at once.
parasharrajat commentedon Mar 28, 2026
How are we looking here @NJ-2020?
22 remaining items
melvin-bot commentedon Sep 7, 2026
This issue has not been updated in over 15 days. @Julesssss, @parasharrajat, @NJ-2020 eroding to Monthly issue.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
Julesssss commentedon Sep 9, 2026
Hi @NJ-2020, how can we unblock this?
parasharrajat commentedon Sep 9, 2026
@Julesssss please reassign this. I am not available now to review this. Thanks.
NJ-2020 commentedon Sep 10, 2026
I am working on it, and I'll make sure I'll speed it up.
Julesssss commentedon Sep 11, 2026
Thanks for your help up to this point @parasharrajat
Julesssss commentedon Sep 22, 2026
Okay on review I think we should close this issue and related PR.
The caching bug seems to have been fixed with #96531 and the remaining flickering issue is small enough to be resolved seperately. Thanks for the work here all.