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
[Due for payment 2026-11-14] [$175] [Exploratory] Native share - Image is duplicated in chat when tapping the Share button several times #93931
Version Number: v9.4.12-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:https://test-management.browserstack.com/projects/2219752/test-runs/60976966/folder/13176721/41236967/1496566574?sort=%2Bidentifier Email or phone of affected tester (no customers): n/a Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: iPhone 13 iOS 26.5 App Component: Chat Report View
Action Performed:
Open the app
On the device media library - Choose a picture or receipt to share through the "Expensify" app
Choose the option as "Share"
Select any contact or workspace
Tap the Share button several times
Expected Result:
Only one image should be shared in the chat regardless of how many times the Share button is tapped.
Actual Result:
Image is duplicated in chat when tapping the Share button several times
ShareButton passes only onPress to Button. It never sets isLoading or isDisabled. handleShare only checks that an attachment exists. It does not check whether a share is already running.
For files, handleShare calls readFileAsync. That function reads the file asynchronously, then calls addAttachmentWithComment and navigates away. The button stays active during the read and the modal dismissal. Each tap in that window starts another read, and each read posts the image again.
The generic useSingleExecution lock in the pressable does not help. handleShare returns void, so the lock releases about one tick after the tap, before the file read finishes.
The text-share path has the same gap, because navigation happens on a later animation frame.
The sibling Submit flow already guards this. SubmitDetailsPage.tsx:609-613 uses a formHasBeenSubmitted ref and resets it on read failure at line 633.
No guard was ever removed. ShareDetailsPage has never had one. This is not a regression from a specific PR.
What changes do you think we should make in order to solve the problem?
Use the same pattern as SubmitDetailsPage:
In ShareDetailsPage, add an isSharingRef ref and an isSharing state.
At the top of handleShare, return early if isSharingRef.current is true. Otherwise set the ref and the state to true. This covers both the text and file paths.
In the readFileAsync failure callback, reset the ref and the state so the user can retry.
Add an isLoading prop to ShareButton, pass it to Button, and pass isSharing from ShareDetailsPage.
What alternative solutions did you explore? (Optional)
Return the readFileAsync Promise from handleShare so useSingleExecution holds the lock. This is weaker: the lock releases when onSuccess returns, before the navigation and dismiss animation finish, so late taps could still post again.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/93931) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
The generic tap guard therefore releases before the asynchronous file read finishes. Another tap can start another read, and each successful callback sends an attachment.
Correction to my earlier analysis: this was present from the feature’s introduction—not a subsequently removed guard. That identifies the introducing PR, although I haven’t verified the first affected release through historical iOS testing.
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal
Precondition:
This flow is accessible only on native devices
Test:
Open the app
On the device media library - Choose a picture or receipt to share through the "Expensify" app
Activity
applause-bot commentedon Jun 18, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/f1fcb4bad6f7ac7e7177f5c32d5d3909cb8ebb9957fb986ecc351d33eafc00a1
melvin-bot commentedon Aug 31, 2026
@applause-bot[bot], this Monthly task hasn't been acted upon in 6 weeks; closing.
If you disagree, feel encouraged to reopen it -- but pick your least important issue to close instead.
unzig21 commentedon Oct 6, 2026
This issue is reproducible in the latest staging v9.5.3-0 for the QA team
ScreenRecording_10-05-2026.19-40-20_1.mp4
MelvinBot commentedon Oct 6, 2026
Proposal
What is the root cause of that problem?
The Share page has no guard against repeat taps.
ShareButtonpasses onlyonPresstoButton. It never setsisLoadingorisDisabled.handleShareonly checks that an attachment exists. It does not check whether a share is already running.For files,
handleSharecallsreadFileAsync. That function reads the file asynchronously, then callsaddAttachmentWithCommentand navigates away. The button stays active during the read and the modal dismissal. Each tap in that window starts another read, and each read posts the image again.The generic
useSingleExecutionlock in the pressable does not help.handleSharereturnsvoid, so the lock releases about one tick after the tap, before the file read finishes.Code references
ShareDetailsPage.tsx:161-163: the only early return; no in-progress check.ShareDetailsPage.tsx:181-223:readFileAsync→addAttachmentWithComment→revealRouteBeforeDismissingModal. The failure callback is empty.ShareDetailsPage.tsx:317:<ShareButton onPress={handleShare} />.FileUtils.ts:275-313:readFileAsyncdoesfetch+blob()before callingonSuccess.useSingleExecution/index.native.ts:33-60: releases the lock right away when the action doesn't return a Promise.The text-share path has the same gap, because navigation happens on a later animation frame.
The sibling Submit flow already guards this.
SubmitDetailsPage.tsx:609-613uses aformHasBeenSubmittedref and resets it on read failure at line 633.No guard was ever removed.
ShareDetailsPagehas never had one. This is not a regression from a specific PR.What changes do you think we should make in order to solve the problem?
Use the same pattern as
SubmitDetailsPage:ShareDetailsPage, add anisSharingRefref and anisSharingstate.handleShare, return early ifisSharingRef.currentis true. Otherwise set the ref and the state to true. This covers both the text and file paths.readFileAsyncfailure callback, reset the ref and the state so the user can retry.isLoadingprop toShareButton, pass it toButton, and passisSharingfromShareDetailsPage.What alternative solutions did you explore? (Optional)
Return the
readFileAsyncPromise fromhandleSharesouseSingleExecutionholds the lock. This is weaker: the lock releases whenonSuccessreturns, before the navigation and dismiss animation finish, so late taps could still post again.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/93931)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
43 remaining items
MelvinBot commentedon Nov 12, 2026
Introduced by Share extension Android and iOS implementation, merged March 19, 2025.
The PR added the native sharing flow with:
handleSharehandler that startsreadFileAsyncwithout returning its Promise or holding an in-progress lock.The generic tap guard therefore releases before the asynchronous file read finishes. Another tap can start another read, and each successful callback sends an attachment.
The feature was briefly reverted, then restored unchanged by Revert “Revert ‘Share extension Android and iOS implementation’”, merged March 24, 2025.
Correction to my earlier analysis: this was present from the feature’s introduction—not a subsequently removed guard. That identifies the introducing PR, although I haven’t verified the first affected release through historical iOS testing.
view run
Eskalifer1 commentedon Nov 12, 2026
Contributor+ Checklist:
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: https://github.com/Expensify/App/pull/55748/changes#r4550332212
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
melvin-bot commentedon Nov 13, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Nov 13, 2026
Payment Summary
Resolving PRs:
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Nov 17, 2026
Claude posting on behalf of Matt:
Ready. Job price: $175 (standard, no Help Wanted, assigned 2026-11-03).
No deploy blockers or regressions on the issue or the PR.
Next: press Caps+Y, then pay.
Evidence
PAYPREP v1mallenexpensify commentedon Nov 17, 2026
Payment Summary
Contributor+: @Eskalifer1 due $175 via Upwork
@Eskalifer1 can you please accept the job below? Please reply here and tag me once you have.
https://www.upwork.com/jobs/~022122819982366628510
Eskalifer1 commentedon Nov 17, 2026
Hi @mallenexpensify, i have accepted, thank you!