Skip to content

[Due for payment 2026-11-14] [$175] [Exploratory] Native share - Image is duplicated in chat when tapping the Share button several times #93931

Open

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


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:

  1. Open the app
  2. On the device media library - Choose a picture or receipt to share through the "Expensify" app
  3. Choose the option as "Share"
  4. Select any contact or workspace
  5. 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

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome Safari

Screenshots/Videos

Bug7184173_1781745285422.ScreenRecording_06-17-2026_20-13-08_1.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7184173

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @Eskalifer1

Activity

  1. applause-bot commented on Jun 18, 2026

    @applause-bot
    Author

    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

  2. melvin-bot commented on Aug 31, 2026

    @melvin-bot

    @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.

  3. unzig21 commented on Oct 6, 2026

    @unzig21

    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
  4. reopened this on Oct 6, 2026
  5. added
    BugSomething is broken. Auto assigns a BugZero manager.
    and removed on Oct 6, 2026
  6. MelvinBot commented on Oct 6, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    The Share page has no guard against repeat taps.

    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.

    Code references

    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:

    1. In ShareDetailsPage, add an isSharingRef ref and an isSharing state.
    2. 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.
    3. In the readFileAsync failure callback, reset the ref and the state so the user can retry.
    4. 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.


    view run

  7. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Oct 6, 2026
  8. 43 remaining items

  9. MelvinBot commented on Nov 12, 2026

    @MelvinBot
    Contributor

    Introduced by Share extension Android and iOS implementation, merged March 19, 2025.

    The PR added the native sharing flow with:

    • A handleShare handler that starts readFileAsync without returning its Promise or holding an in-progress lock.
    • A Share button without loading/disabled state.

    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

  10. Eskalifer1 commented on Nov 12, 2026

    @Eskalifer1
    Contributor

    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:

    • This flow is accessible only on native devices

    Test:

    1. Open the app
    2. On the device media library - Choose a picture or receipt to share through the "Expensify" app
    3. Choose the option as "Share"
    4. Select any contact or workspace
    5. Tap the Share button several times
    6. Make sure only one image is shared in the chat

    Do we agree 👍 or 👎

  11. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Nov 13, 2026
  12. melvin-bot commented on Nov 13, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  13. melvin-bot commented on Nov 13, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    Upwork Job

    • Assignee: @Eskalifer1 requires payment (Needs manual offer from BZ)

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  14. mallenexpensify commented on Nov 17, 2026

    @mallenexpensify
    Contributor

    Claude posting on behalf of Matt:

    Ready. Job price: $175 (standard, no Help Wanted, assigned 2026-11-03).

    • Eskalifer1 (C+): 100%, via Upwork

    No deploy blockers or regressions on the issue or the PR.

    Next: press Caps+Y, then pay.

    Evidence
    • C+ checklist, with 6 test steps: comment. No TestRail case yet.
    • Resolving PR 105832: by MelvinBot, merged 2026-11-05, approved by Eskalifer1, JmillsExpensify and mountiny. No revert.
    • Offending PR 55748 by filip-solecki, merged 2025-03-19. No payee wrote or reviewed it. Outside the regression window.
    • Videos: author 1/5, C+ 2/5.

    PAYPREP v1

  15. mallenexpensify commented on Nov 17, 2026

    @mallenexpensify
    Contributor

    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

  16. Eskalifer1 commented on Nov 17, 2026

    @Eskalifer1
    Contributor

    Hi @mallenexpensify, i have accepted, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions