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
Chat - Edited file name is not saved when editing file name in offline mode #98696
Version Number: 9.4.54-0 Reproducible in staging?: Yes Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught during regression testing, add the test name, ID and link from BrowserStack:#97935 Email or phone of affected tester (no customers):sdsiodjnosdjiodsj@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.5 / Chrome App Component: Other
Action Performed:
Go to staging.new.expensify.com
Go to any chat.
Go offline.
Send a text with CSV fule attachment.
Right click on the message > Edit comment.
Edit the file name and save it.
Right click on the message > Edit comment.
Expected Result:
The edited file name will be saved.
Actual Result:
The edited file name is not saved.
It still shows the original file name despite editing it.
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
Root cause: Confirmed — #97935 ("Show Edit comment for text and attachment messages while the attachment uploads") introduced this. When you rename a still‑pending (offline) attachment and save, the edit path strips the entire local attachment reference — including the edited name — out of the saved draft, then re‑renders and re‑queues the message with the original filename. High confidence.
Recommendation: Roll forward with a targeted fix — do not revert. A revert re‑breaks the intended feature from #94878 (editing a text+attachment message while it uploads). This is a narrow offline edge case (renaming an attachment's link text while pending); text edits and the attachment itself are preserved, so there's no data loss.
Before #97935, canEditReportAction treated an optimistic text + attachment action as non‑editable, so "Edit comment" was never offered while the message was pending/offline. #97935 changed that gate so only attachment‑only optimistic comments stay non‑editable:
// Only an attachment-only comment has nothing to edit while it uploads; text keeps it editable throughout.constisOptimisticAttachment=!!reportAction?.isOptimisticAction&&!!reportAction?.isAttachmentOnly;
The exact path in this bug — opening "Edit comment" on a still‑pending (offline) text+CSV message — is only reachable because of #97935, and every helper the edit path now runs through (replaceLocalAttachmentReferences, getUploadingAttachmentHtmlFromComment, isUploadingAttachmentRemovedFromDraft) was introduced by this PR.
Root cause — the edited name is dropped in three places
While pending (offline), the attachment appears in the edit draft as a local markdown reference, e.g. [myfile.csv](blob:…). Renaming it to [renamed.csv](blob:…) and saving:
1. Saved draft — replaceLocalAttachmentReferences takes the "still uploading" branch and strips the whole reference, discarding the edited name:
3. Queued request — because the attachment was kept, shouldRemoveQueuedAttachment is false, so the queued AddTextAndAttachment request re‑attaches with the original filename when it syncs (src/libs/actions/RequestConflictUtils.ts:280-302).
Why it's a real regression (not pre‑existing): once synced (online), the draft holds an https reference, which localAttachmentReferenceRegex (only blob:|file:|content:) does not match — so an online rename survives. Only the offline/pending case throws the edit away.
Targeted fix — preserve the edited name through the pending path
Three coordinated changes:
replaceLocalAttachmentReferences (ReportUtils.ts:6695-6698) — in the isStillUploading branch, detect when the draft's link text/name differs from the original attachment name and carry the new name forward (rewrite the reference to the synced/queued form with the edited name) rather than returning empty.
Optimistic render (Report/index.ts:3567-3568) — instead of re‑appending the untouched getUploadingAttachmentHtmlFromComment(originalCommentHTML), apply the edited name to that tag (rewrite its data-name / link text / alt) so the pending message shows the new name immediately.
Queued request (RequestConflictUtils.tsresolveEditCommentWithNewAddCommentRequest, ~L296) — when the attachment is kept but renamed, update currentAddComment.data.file.name (and the attachment name param) so the server stores the new filename on sync.
Assignees are already correct: mukhrr (author) and reviewers youssef-lr, brunovjk. Keep the DeployBlockerCash label (frontend App regression, new‑feature).
Next Steps for Contributor+ team: To accept:@MelvinBot implement this to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Ya I wonder why the OP says N/A - new feature, doesn't exist in prod - it seems like there is a bug reproducible on prod, so it would make sense this is NAB - is that how you understand it too @mukhrr ?
Activity
applause-bot commentedon Aug 14, 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/79f629beb3346576090c8462812003e9c817667da3cca5c8fe776ac71ca694bc
melvin-bot commentedon Aug 14, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #97935
melvin-bot commentedon Aug 14, 2026
@youssef-lr @brunovjk you have been assigned to this deploy blocker because you reviewed the offending PR: #97935
github-actions commentedon Aug 14, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
melvin-bot commentedon Aug 14, 2026
💬 A slack conversation has been started in #expensify-open-source
MelvinBot commentedon Aug 14, 2026
Deploy Blocker Analysis
Root cause: Confirmed — #97935 ("Show Edit comment for text and attachment messages while the attachment uploads") introduced this. When you rename a still‑pending (offline) attachment and save, the edit path strips the entire local attachment reference — including the edited name — out of the saved draft, then re‑renders and re‑queues the message with the original filename. High confidence.
Recommendation: Roll forward with a targeted fix — do not revert. A revert re‑breaks the intended feature from #94878 (editing a text+attachment message while it uploads). This is a narrow offline edge case (renaming an attachment's link text while pending); text edits and the attachment itself are preserved, so there's no data loss.
Why #97935 is the cause
Before #97935,
canEditReportActiontreated an optimistic text + attachment action as non‑editable, so "Edit comment" was never offered while the message was pending/offline. #97935 changed that gate so only attachment‑only optimistic comments stay non‑editable:src/libs/ReportUtils.ts:5427-5431:(previously
&& (!!reportAction?.isAttachmentOnly || !!reportAction?.isAttachmentWithText))The exact path in this bug — opening "Edit comment" on a still‑pending (offline) text+CSV message — is only reachable because of #97935, and every helper the edit path now runs through (
replaceLocalAttachmentReferences,getUploadingAttachmentHtmlFromComment,isUploadingAttachmentRemovedFromDraft) was introduced by this PR.Root cause — the edited name is dropped in three places
While pending (offline), the attachment appears in the edit draft as a local markdown reference, e.g.
[myfile.csv](blob:…). Renaming it to[renamed.csv](blob:…)and saving:1. Saved draft —
replaceLocalAttachmentReferencestakes the "still uploading" branch and strips the whole reference, discarding the edited name:src/libs/ReportUtils.ts:6688-6718:2. Optimistic render — the attachment is re‑appended using the original, unedited optimistic tag:
src/libs/actions/Report/index.ts:3538-3569:3. Queued request — because the attachment was kept,
shouldRemoveQueuedAttachmentisfalse, so the queuedAddTextAndAttachmentrequest re‑attaches with the original filename when it syncs (src/libs/actions/RequestConflictUtils.ts:280-302).Why it's a real regression (not pre‑existing): once synced (online), the draft holds an
httpsreference, whichlocalAttachmentReferenceRegex(onlyblob:|file:|content:) does not match — so an online rename survives. Only the offline/pending case throws the edit away.Targeted fix — preserve the edited name through the pending path
Three coordinated changes:
replaceLocalAttachmentReferences(ReportUtils.ts:6695-6698) — in theisStillUploadingbranch, detect when the draft's link text/name differs from the original attachment name and carry the new name forward (rewrite the reference to the synced/queued form with the edited name) rather than returning empty.Report/index.ts:3567-3568) — instead of re‑appending the untouchedgetUploadingAttachmentHtmlFromComment(originalCommentHTML), apply the edited name to that tag (rewrite itsdata-name/ link text /alt) so the pending message shows the new name immediately.RequestConflictUtils.tsresolveEditCommentWithNewAddCommentRequest, ~L296) — when the attachment is kept but renamed, updatecurrentAddComment.data.file.name(and the attachment name param) so the server stores the new filename on sync.Assignees are already correct:
mukhrr(author) and reviewersyoussef-lr,brunovjk. Keep theDeployBlockerCashlabel (frontend App regression, new‑feature).Next Steps for Contributor+ team:
To accept:
@MelvinBot implement thisto create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
mukhrr commentedon Aug 15, 2026
hmm not sure if this is a regression or not. On Production, editing filename makes it just link while losing format.
What it does currently:
REC-20260815061049.mp4
What I mean/propose:
REC-20260815061213.mp4
cc @youssef-lr @brunovjk
Beamanator commentedon Aug 16, 2026
Ya I wonder why the OP says
N/A - new feature, doesn't exist in prod- it seems like there is a bug reproducible on prod, so it would make sense this is NAB - is that how you understand it too @mukhrr ?mukhrr commentedon Aug 17, 2026
@Beamanator Alex, exactly!
mukhrr commentedon Aug 17, 2026
@Beamanator I think they reported the exact issue #98743. Can we close this and continue in #98743 as follow up? cc @youssef-lr @brunovjk
Beamanator commentedon Aug 17, 2026
will demote this but i'm not sure if we want to close this or not, will let @youssef-lr deal with that 👍