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-08-11] [$250] [Exploratory] Chat - Unable to edit parent message after replying in thread #92077
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 contributorNot a priority
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
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.
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.
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 contributorNot a priority
Activity
applause-bot commentedon May 29, 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/f88a5181c8c067b08d1dc9908231f98e065851fb4163d9df64afadc7bdac4a27
[-][Exploratory] 92014 - Chat - Unable to edit parent message after replying in thread[/-][+][Exploratory] Chat - Unable to edit parent message after replying in thread[/+]MelvinBot commentedon Jul 17, 2026
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 —
canEditReportActionhas no thread/childReportIDcondition. 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
reportActionfrom the row — it re‑hydrates it from the actions oforiginalReportIDatBaseReportActionContextMenu.tsx:183‑188.originalReportIDfor the ancestor row comes fromuseOriginalReportID. 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 returnsundefined:reportActionBelongsCurrentReport→ false (action not in the loaded slice),isThreadReportParentAction(childReportID === reportID) → false (its child thread is not the report it lives in),undefined.With
originalReportID = undefined,originalReportActionsis empty, so the re‑hydratedreportActionisundefined, and Edit'sshouldShowrunscanEditReportAction(undefined)→ Edit disappears / no‑ops.Notably, this hook disagrees with the util
getOriginalReportIDused on the save/read‑back side, which in the same "action not found" case falls back toreportIDrather thanundefined. 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:
useOriginalReportID's final fallback withgetOriginalReportID— returnreportIDinstead ofundefinedwhen 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.BaseReportActionContextMenu, fall back to thereportAction/reportIDpassed from the row whenoriginalReportIDresolves 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
reportActionis 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/reportActionhydrate toundefined(most likely, above); (2) Edit appears but no‑ops — the draft is written to one bucket viasaveReportActionDraft→getOriginalReportIDbut the read path (useActiveDraftReportActionwalking the ancestor chain) resolves a different bucket. To disambiguate: repro on device loggingoriginalReportID+ whetherREPORT_ACTIONS_<home reportID>is loaded for the ancestor at menu time, or add aChat → Thread → nested Threadunit 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.
melvin-bot commentedon Jul 17, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hoangzinh (
External)33 remaining items
melvin-bot commentedon Aug 10, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Aug 10, 2026
Payment Summary
Resolving PRs:
Fix parent message not editable from a nested thread #97418
Reviewer: @hoangzinh owed $250 via NewDot
Reviewer: @mukhrr owed $250 via NewDot
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Aug 13, 2026
Payment Summary
Contributor: @mukhrr due $250 via NewDot
Contributor+: @hoangzinh due $250 via NewDot
flaviadefaria commentedon Aug 21, 2026
Approved: @mukhrr due $250 via NewDot
laurenreidexpensify commentedon Aug 25, 2026
$250 approved @hoangzinh New Expensify