Skip to content

[Due for payment 2026-08-25] [$250] [Exploratory] Chat-In text plus attachment chat , edit comment option is not shown. #94878

Closed

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.22-2
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/62515474/folder/13176723/41237047/1526209114?sort=%2Bcase_type
Email or phone of affected tester (no customers): dreamnitethedragon+vegst@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Redmi note 10s android 13
App Component: Chat Report View

Action Performed:

  1. Launch app
  2. Open a chat
  3. Send a text and attachment
  4. Long press the message and note edit comment option is not shown

Expected Result:

In text plus attachment chat , edit comment option must be shown.

Actual Result:

In text plus attachment chat , edit comment option is not shown.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7194490_1782748437752.Screenrecorder-2026-06-29-21-18-50-133.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7194490

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @youssef-lr

Activity

  1. applause-bot commented on Jun 29, 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/4b1b346000aa55a008ffd3b0c49fd4f0dde1320ed951383c296c11a5cde4f2a3

  2. added
    Daily
    and removed on Jul 6, 2026
  3. melvin-bot commented on Jul 6, 2026

    @melvin-bot

    📣 @teasikon15-afk! 📣
    Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
    Please follow these steps:

    1. Make sure you've read and understood the contributing guidelines.
    2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
    3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
    4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
      Screen Shot 2022-11-16 at 4 42 54 PM
      Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
    
  4. melvin-bot commented on Jul 9, 2026

    @melvin-bot

    Whoops! This issue is 2 days overdue. Let's get this updated quick!

  5. melvin-bot commented on Jul 9, 2026

    @melvin-bot

    Whoops! This issue is 2 days overdue. Let's get this updated quick!

  6. melvin-bot commented on Jul 13, 2026

    @melvin-bot

    6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  7. melvin-bot commented on Jul 15, 2026

    @melvin-bot

    8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

  8. added
    Bug
    on Jul 17, 2026
  9. MelvinBot commented on Jul 17, 2026

    @MelvinBot
    Contributor

    Proposal

    ℹ️ Medium confidence — the gate and mechanism below are verified against the code; the exact trigger (see the note at the end) should be confirmed with a repro on the current build.

    What is the root cause of that problem?

    Whether the Edit comment option appears is decided entirely by canEditReportAction (the editAction entry's shouldShow at ContextMenuActions.tsx:605-609).

    That function blocks editing whenever a message is an "optimistic attachment" (ReportUtils.ts:5357):

    isOptimisticAttachment = isOptimisticAction && (isAttachmentOnly || isAttachmentWithText)
    

    A text-plus-attachment message is built with isAttachmentWithText: true and isOptimisticAction: true (ReportUtils.ts:6597-6598). So while its optimistic upload is in flight — or any time that optimistic flag isn't cleared for the action — isOptimisticAttachment is true and Edit is hidden, even though the message contains freely-editable text. Including isAttachmentWithText in this block is the flaw: the text portion is always editable, so a text+attachment message should never be treated as un-editable the way a pure attachment is.

    What changes do you think we should make in order to solve the problem?

    Remove isAttachmentWithText from the block condition in canEditReportAction (ReportUtils.ts:5357). Only a pure attachment (isAttachmentOnly) should be blocked while it is still optimistic/uploading. A message that has text should always offer Edit — matching the issue's Expected Result ("In text plus attachment chat, edit comment option must be shown").

    What alternative solutions did you explore? (Optional)

    If the trigger turns out to be a lingering optimistic flag rather than the upload window (i.e. isOptimisticAction isn't being reset to null on the synced text+attachment action), the alternative is to ensure the success/refresh path clears it — the AddComment success handler already does this at Report/index.ts:1058, so the ADD_TEXT_AND_ATTACHMENT path would need the same guarantee. The primary fix above is still recommended because it makes Edit correct regardless of the optimistic state.

    Investigation details & open question
    • Long-pressing anywhere on the combined bubble (text or image) fires the same CONTEXT_MENU_TYPES.REPORT_ACTION menu (ShowContextMenuContext/index.tsx), so this is not an "image vs. text portion" issue — there is a single gate: canEditReportAction.
    • Text+attachment is sent as one action via ADD_TEXT_AND_ATTACHMENT (Report/index.ts:914-920).
    • Open question / what to verify: the current guard is keyed on isOptimisticAction, so a fully-synced message should already be editable. The repro on V9.4.22-2 (staging + production) suggests the block is being hit either during the upload window or because the optimistic flag persists for this action. Worth confirming on the latest build whether Edit is missing only briefly (upload window) or permanently (lingering flag) — that determines whether the primary fix alone is sufficient.

    Possibly related


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/94878) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

  10. added
    External
    on Jul 17, 2026
  11. 68 remaining items

  12. mallenexpensify commented on Sep 2, 2026

    @mallenexpensify
    Contributor

    I'm working with Claude to build a rubric for analyzing regressions. The current framework is

    Not a regression from the linked PR

    Bug was already on production. The PR exposed it, didn't create it. Test: build from the commit before the merge and repro. Precedent: 99143 on 98809, paid in full.
    The original issue never asked for the behavior. Test: if the new work is never done, is the original issue still correctly closed? Yes = followup, and the new issue carries its own price. Precedent: 96390 / 98488. Covers scope creep.
    The PR delivered what was specified and the spec was wrong. Behavior matches the issue body or design, we changed our mind after the merge. New work, full price.
    The behavior was known and accepted before the merge. Precedent: 99155 on 98809. The comment has to exist from that time, not first appear when payment is disputed.
    A different PR caused it, or the interaction of two did. Claimant names the other PR. "Something else may have done it" isn't a reason.
    The regression window closed. Merge to 168 hours after production. After that it's an ordinary bug and pays like any issue.

    A regression, but this payee isn't liable

    They didn't write or review the offending PR. Anyone else assigned to fix it earns the job price.
    The assigned internal engineer waived the C+ penalty for a large PR introducing new functionality. Already in the C+ doc, only the employee grants it.

    and Claude's response from reviewing this issue was

    $125 each to mukhrr and brunovjk. One confirmed regression, 50%. Separately, 98692 should be $0 with Skip Payment.

    Running the framework against 98692:

    Already on production - fails. Melvin verified getUploadingAttachmentHtmlFromComment and the editReportComment optimistic-HTML build did not exist before 97935. The fault is in code that PR added.
    Original issue never asked for it - fails. 94878 asked for Edit comment to work on text plus attachment. An edit that destroys the attachment does not close it correctly. Regression under the test.
    Spec was wrong / known and accepted before the merge - no comment exists from that time.
    A different PR - no. Melvin named 97935 at high confidence and recommended a revert.
    Window closed - no. Blocker filed 2026-08-14, the same day 97935 merged.
    Payee not liable - fails for both. mukhrr authored 97935, brunovjk approved it. Melvin assigned both on that basis.
    C+ waiver - the only route open, and it is weak. 97935 is 212 additions across 5 files, but it is a bug fix, not new functionality. Only youssef-lr can grant it, and he also approved the PR.

    brunovjk's staging argument you already answered. His second half, that the original bug hid this in production, is also not a defence: the video path had no round-trip test in 97935, which is exactly what review should have caught.

    cc @youssef-lr in case you find it helpful (if not and/or you have any feedback, let me know here or in NewDot

  13. mallenexpensify commented on Sep 2, 2026

    @mallenexpensify
    Contributor

    @MelvinBot will you review the above as a sanity check? I have a Claude project for contributor improvements and am want to continually sanity check it while building out the process

  14. MelvinBot commented on Sep 2, 2026

    @MelvinBot
    Contributor

    The conclusion holds — $125 each to mukhrr and brunovjk, and $0 on #98692. Every factual claim in Claude's analysis checked out against the PRs, the diff, and CONTRIBUTING.md. Five things to add.

    1. Claude found one regression; there were three candidates. PR #97935 was also named as the offending PR on #98696 and #98743. Both are correctly excluded — 98696 was demoted after mukhrr and Beamanator agreed the underlying bug repros on production, and 98743 reports "Reproducible in production?: Yes" and is now a Monthly / Not a priority follow-up. So the count of one stands. But the analysis should have surfaced and cleared them, not omitted them: the policy applies the penalty "for each regression on an issue," so a missed second regression is the difference between $125 and $0.

    2. The $0 on 98692 is right, but it doesn't come from your rubric. It comes from contributingGuides/CONTRIBUTING.md:75 — "work to fix regressions caused by the PR is unpaid by default." Your framework has no rule for how the fix issue pays, and no rule for penalties stacking across multiple regressions. Both are worth adding.

    3. The C+ waiver only covers the C+. Even if youssef-lr granted it, it touches brunovjk only — mukhrr stays at $125 as the Contributor. Claude framed it as the one route open for both.

    4. The Payment Summary role labels are wrong. It lists both as "Reviewer." mukhrr is the Contributor — they wrote the accepted proposal and authored #97935. Same $250 base either way, but your checklist item is "confirm assignees, roles."

    5. No Payment Summary was ever generated on 98692, so there is nothing to actively skip — just don't create one.

    Claims I verified
    • PR size: 212 additions / 11 deletions across 5 files. Matches.
    • Authorship: mukhrr authored Show Edit comment for text and attachment messages while the attachment uploads #97935; brunovjk approved 2026-08-12; youssef-lr approved 2026-08-14. Merged 2026-08-14T00:13:33Z.
    • "Already on production" test fails: getUploadingAttachmentHtmlFromComment and replaceLocalAttachmentReferences are added lines in the 97935 diff — they did not exist before it. The fault is in code that PR introduced.
    • Window open: 98692 was filed 2026-08-14T21:27:25Z, the same day 97935 merged. CONTRIBUTING.md:74 starts the window at merge, which also settles the staging-only argument the way you already answered it.
    • 50% per regression: CONTRIBUTING.md:76.
    • "No round-trip test for the video path": accurate. 97935's added tests cover blob:, file:, document anchors, and https — no video case.
    • One correction to Claude's framing: it says Melvin "recommended a revert." Melvin did, but the team rolled forward instead — [CP Staging] Keep a video attachment when a comment is edited twice while it uploads #98702 (mukhrr, 53 additions) shipped in 9.4.54-4 on 2026-08-18. Doesn't change liability, but the record should be accurate.
    • Timing: 98702 hit production 2026-08-18, so the 7-day post-fix payment date of 2026-08-25 was correct and payment is now overdue.

    On the rubric itself: the structure is good — it's falsifiable, each branch has a test, and the precedents give it teeth. Two gaps beyond the ones above. First, add an explicit "enumerate every issue naming this PR as the offending PR" step before running the branches, or the framework silently assumes the regression count it was handed. Second, the "already on production" branch was the one that did real work here (it cleared two of three candidates), and in both cases the evidence was a human's repro, not the "build from the commit before the merge" test as written. Worth broadening that test to accept a QA "reproducible in production: yes" or a documented repro from someone on the issue.


    view run

  15. brunovjk commented on Sep 2, 2026

    @brunovjk
    Contributor

    Great, @mallenexpensify. I’m good with $125. Thank you!

  16. added
    Weekly
    and removed
    Daily
    on Sep 2, 2026
  17. melvin-bot commented on Sep 2, 2026

    @melvin-bot

    @youssef-lr Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  18. mukhrr commented on Sep 3, 2026

    @mukhrr
    Contributor

    me too. thanks

  19. youssef-lr commented on Sep 3, 2026

    @youssef-lr
    Contributor

    Agreed with Melvin here.

  20. mallenexpensify commented on Sep 3, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor: @mukhrr due $125 via NewDot
    Contributor+: @brunovjk due $125 via NewDot

  21. laurenreidexpensify commented on Sep 4, 2026

    @laurenreidexpensify
    Contributor

    $125 approved @brunovjk New Expensify

  22. flaviadefaria commented on Sep 11, 2026

    @flaviadefaria
    Contributor

    Approved: @mukhrr owed $125 via NewDot

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

Metadata

Metadata

Labels

Awaiting PaymentBugExternalNot a priorityWeekly

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions