Skip to content

[Due for payment 2026-08-11] [$250] [Exploratory] Chat - Unable to edit parent message after replying in thread #92077

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: 9.3.89-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/TR-35253/folder/13177078/41237900/1447303074
Email or phone of affected tester (no customers): applausetester+abr2ky@applause.expensifail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Android, IOS
App Component: Other

Action Performed:

  1. Go to new expensify app.
  2. Open any chat.
  3. Send a message.
  4. Click Reply in thread on the message.
  5. Send a message in the thread.
  6. Click on the thread message and select Reply in thread again.
  7. Try to edit the main parent message.

Expected Result:

The parent message should be editable.

Actual Result:

Unable to edit parent message after replying in thread

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7166042_1780028308875.WhatsApp_Video_2026-05-29_at_06.09.56.mp4

View all open jobs on GitHub

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

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

Activity

  1. applause-bot commented on May 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/f88a5181c8c067b08d1dc9908231f98e065851fb4163d9df64afadc7bdac4a27

  2. changed the title [-][Exploratory] 92014 - Chat - Unable to edit parent message after replying in thread[/-] [+][Exploratory] Chat - Unable to edit parent message after replying in thread[/+] on May 29, 2026
  3. added
    Bug
    on Jul 17, 2026
  4. MelvinBot commented on Jul 17, 2026

    @MelvinBot
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    After replying in a thread — and then opening a nested thread on top of that (reply in thread → reply in thread again) — the original parent message shown at the top of the thread can no longer be edited on Android/iOS. Expected: the parent message stays editable.

    What is the root cause of that problem?

    Editability itself is not blocked by having a child thread — canEditReportAction has no thread/childReportID condition. The failure is in how the edit target is resolved for a message rendered as an ancestor preview at the top of a (nested) thread.

    The context menu does not act on the reportAction from the row — it re‑hydrates it from the actions of originalReportID at BaseReportActionContextMenu.tsx:183‑188. originalReportID for the ancestor row comes from useOriginalReportID. For a parent message whose home report's actions are not currently loaded/subscribed (its home report is not the open report — only the nested threads are), that hook falls through every branch and returns undefined:

    • reportActionBelongsCurrentReport → false (action not in the loaded slice),
    • isThreadReportParentAction (childReportID === reportID) → false (its child thread is not the report it lives in),
    • no single-transaction thread → undefined.

    With originalReportID = undefined, originalReportActions is empty, so the re‑hydrated reportAction is undefined, and Edit's shouldShow runs canEditReportAction(undefined) → Edit disappears / no‑ops.

    Notably, this hook disagrees with the util getOriginalReportID used on the save/read‑back side, which in the same "action not found" case falls back to reportID rather than undefined. This resolver mismatch is the crux, and it plausibly explains the platform split (mobile is more aggressive about dropping non‑visible report‑action subscriptions than web).

    What changes do you think we should make?

    Make ancestor‑preview edit resolution consistent so the parent message stays editable:

    • Align useOriginalReportID's final fallback with getOriginalReportID — return reportID instead of undefined when the action can't be located, and/or subscribe to the ancestor's home‑report actions so the action is found in the first branch.
    • As a defensive measure in BaseReportActionContextMenu, fall back to the reportAction/reportID passed from the row when originalReportID resolves empty, instead of hard‑gating the whole menu on the re‑hydrated action.

    What alternative solutions did you explore?

    Guarding the Edit action to still show when reportAction is undefined but the row's action is editable — rejected as it treats the symptom (menu gating) rather than the resolver inconsistency, and would need matching fixes on the draft round‑trip path.

    Confidence & how to confirm

    Medium confidence. The code path is fully traced with file:line evidence, but the exact triggering branch was not confirmed at runtime (no device repro in this environment). Two candidate failure gates exist and have different fixes: (1) Edit missing — originalReportID/reportAction hydrate to undefined (most likely, above); (2) Edit appears but no‑ops — the draft is written to one bucket via saveReportActionDraft→getOriginalReportID but the read path (useActiveDraftReportAction walking the ancestor chain) resolves a different bucket. To disambiguate: repro on device logging originalReportID + whether REPORT_ACTIONS_<home reportID> is loaded for the ancestor at menu time, or add a Chat → Thread → nested Thread unit test asserting the top ancestor is editable.

    Relevant files: src/hooks/useOriginalReportID.ts, src/pages/inbox/report/ContextMenu/BaseReportActionContextMenu.tsx, src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx, src/pages/inbox/report/useActiveDraftReportAction.ts, src/libs/ReportUtils.ts (getOriginalReportID, getAncestors, canEditReportAction).


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

  5. added
    External
    on Jul 17, 2026
  6. added
    Help Wanted
    on Jul 17, 2026
  7. melvin-bot commented on Jul 17, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @hoangzinh (External)

  8. 33 remaining items

  9. added
    Daily
    Awaiting Payment
    and removed
    Weekly
    on Aug 10, 2026
  10. melvin-bot commented on Aug 10, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  11. melvin-bot commented on Aug 10, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
  12. mallenexpensify commented on Aug 13, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor: @mukhrr due $250 via NewDot
    Contributor+: @hoangzinh due $250 via NewDot

  13. flaviadefaria commented on Aug 21, 2026

    @flaviadefaria
    Contributor

    Approved: @mukhrr due $250 via NewDot

  14. laurenreidexpensify commented on Aug 25, 2026

    @laurenreidexpensify
    Contributor

    $250 approved @hoangzinh New Expensify

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternalNot a priority

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions