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-25] Chat - Video link disappears when editing comment for the second time #98692
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: Chat Report View
Action Performed:
Go to staging.new.expensify.com
Go to any chat.
Go offline.
Send a text with video attachment.
Right click on the message > Edit comment.
Edit the text and save it.
Right click on the message > Edit comment.
Expected Result:
Video link will not disappear when editing comment for the second time.
Actual Result:
Video link disappears when editing comment for the second time.
👋 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.
Classification: Frontend bug Causing PR: #97935 - "Show Edit comment for text and attachment messages while the attachment uploads" by @mukhrr (High confidence) Related Issues: None
Recommendation: REVERT
PR #97935 is a self-contained, brand-new feature (not in production) that regresses a core chat action for video/<a>-type attachments; reverting cleanly removes the regression. A small targeted fix is also viable (see Root Cause) if the author prefers to roll forward quickly.
Assigned: @mukhrr (PR author), @youssef-lr and @brunovjk (approving reviewers) from PR #97935 Labels: No change. DeployBlockerCash is kept (App deploy is blocked by an App PR). DeployBlocker was not present, so nothing to remove.
It rewrites exactly the offline "edit a comment that has an uploading attachment" flow described in the repro, touching src/libs/ReportUtils.ts, src/libs/actions/Report/index.ts, and src/libs/actions/RequestConflictUtils.ts.
The bug is video-specific (the issue title is "Video link disappears"), which matches the root cause precisely: images are self-closing (<img ... />) and documents are handled by a separate <a>...</a> branch, but <video>...</video> is mishandled.
Reproducible on staging only, N/A on production (new feature) — consistent with a regression introduced by this staging PR.
When you edit a comment whose attachment is still uploading, editReportComment re-appends the uploading attachment tag to the optimistic message so it keeps showing:
For a video, getUploadingAttachmentHtml builds <video src="blob:X" data-optimistic-src="blob:X" data-expensify-source="blob:X" ...>clip.mp4</video> (ReportUtils.ts L6676-L6678). The img|video branch ends at [^>]*>, so it captures only the opening <video ...> tag and drops the clip.mp4</video> portion. Images are self-closing so this is fine for them, and documents use the dedicated <a>...</a> branch — but videos end up as an unclosed <video> tag.
After the first edit, the stored optimistic HTML therefore contains an unclosed <video ...> element. When you open Edit the second time, the draft is generated via Parser.htmlToMarkdown(getActionHtml(reportAction)) (see ContextMenuActions.tsxeditAction). ExpensiMark's video→markdown rule requires a closing </video> (.../<video[^><]*data-expensify-source...>([^><]*)<\/video>.../), so the unclosed tag does not convert back to attachment markdown and the blob: reference is dropped from the draft entirely.
The second editReportComment then evaluates isUploadingAttachmentRemovedFromDraft(textForNewComment, originalCommentHTML) (Report/index.ts L3538). Because the draft no longer contains the data-optimistic-srcblob: URI, it concludes the user deleted the attachment → shouldRemoveQueuedAttachment = true → uploadingAttachmentHtml = undefined (no re-append) and the queued file/attachmentID are stripped from the pending Add request (RequestConflictUtils.ts). Result: the video link disappears.
Note the img/document unit tests added in the PR pass precisely because those forms round-trip correctly; there is no video round-trip test, so the gap went unnoticed.
Targeted fix (if rolling forward): make the extraction capture the full non-void element, e.g. give <video> the same ...>[\s\S]*?</video> treatment the <a> branch already has (or capture <video\b[^>]*>[\s\S]*?</video>), so the re-appended optimistic HTML is well-formed and round-trips through htmlToMarkdown on the next edit. Adding a video round-trip case to the replaceLocalAttachmentReferences/getUploadingAttachmentHtmlFromComment tests would lock it in.
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.54-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-08-25. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]
changed the title [-]Chat - Video link disappears when editing comment for the second time[/-][+][Due for payment 2026-08-25] Chat - Video link disappears when editing comment for the second time[/+]on Aug 18, 2026
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/c17ed986ee4243d0f5d2c67bb42cde8a3331fc9edfaaa0cfac1791f904991592
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
melvin-bot commentedon Aug 14, 2026
💬 A slack conversation has been started in #expensify-open-source
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:
MelvinBot commentedon Aug 14, 2026
🔍 Investigation Summary
Classification: Frontend bug
Causing PR: #97935 - "Show Edit comment for text and attachment messages while the attachment uploads" by @mukhrr (High confidence)
Related Issues: None
Recommendation: REVERT
PR #97935 is a self-contained, brand-new feature (not in production) that regresses a core chat action for video/
<a>-type attachments; reverting cleanly removes the regression. A small targeted fix is also viable (see Root Cause) if the author prefers to roll forward quickly.Assigned: @mukhrr (PR author), @youssef-lr and @brunovjk (approving reviewers) from PR #97935
Labels: No change.
DeployBlockerCashis kept (App deploy is blocked by an App PR).DeployBlockerwas not present, so nothing to remove.📋 Detailed Analysis
Evidence
src/libs/ReportUtils.ts,src/libs/actions/Report/index.ts, andsrc/libs/actions/RequestConflictUtils.ts.<img ... />) and documents are handled by a separate<a>...</a>branch, but<video>...</video>is mishandled.Verification
src/libs/ReportUtils.ts—getUploadingAttachmentHtmlFromCommentat L6721-L6731src/libs/actions/Report/index.ts—editReportCommentoptimistic-HTML build at L3567-L3569 and the removal check at L35389980966.Root Cause
When you edit a comment whose attachment is still uploading,
editReportCommentre-appends the uploading attachment tag to the optimistic message so it keeps showing:optimisticHtml = ${htmlForNewComment}<br /><br />${uploadingAttachmentHtml}(Report/index.ts L3567-L3568).uploadingAttachmentHtmlcomes fromgetUploadingAttachmentHtmlFromComment, which extracts the tag with this regex (ReportUtils.ts L6726-L6729):For a video,
getUploadingAttachmentHtmlbuilds<video src="blob:X" data-optimistic-src="blob:X" data-expensify-source="blob:X" ...>clip.mp4</video>(ReportUtils.ts L6676-L6678). Theimg|videobranch ends at[^>]*>, so it captures only the opening<video ...>tag and drops theclip.mp4</video>portion. Images are self-closing so this is fine for them, and documents use the dedicated<a>...</a>branch — but videos end up as an unclosed<video>tag.After the first edit, the stored optimistic HTML therefore contains an unclosed
<video ...>element. When you open Edit the second time, the draft is generated viaParser.htmlToMarkdown(getActionHtml(reportAction))(seeContextMenuActions.tsxeditAction). ExpensiMark's video→markdown rule requires a closing</video>(.../<video[^><]*data-expensify-source...>([^><]*)<\/video>.../), so the unclosed tag does not convert back to attachment markdown and theblob:reference is dropped from the draft entirely.The second
editReportCommentthen evaluatesisUploadingAttachmentRemovedFromDraft(textForNewComment, originalCommentHTML)(Report/index.ts L3538). Because the draft no longer contains thedata-optimistic-srcblob:URI, it concludes the user deleted the attachment →shouldRemoveQueuedAttachment = true→uploadingAttachmentHtml = undefined(no re-append) and the queuedfile/attachmentIDare stripped from the pending Add request (RequestConflictUtils.ts). Result: the video link disappears.Note the img/document unit tests added in the PR pass precisely because those forms round-trip correctly; there is no video round-trip test, so the gap went unnoticed.
Targeted fix (if rolling forward): make the extraction capture the full non-void element, e.g. give
<video>the same...>[\s\S]*?</video>treatment the<a>branch already has (or capture<video\b[^>]*>[\s\S]*?</video>), so the re-appended optimistic HTML is well-formed and round-trips throughhtmlToMarkdownon the next edit. Adding a video round-trip case to thereplaceLocalAttachmentReferences/getUploadingAttachmentHtmlFromCommenttests would lock it in.mukhrr commentedon Aug 15, 2026
@brunovjk can we review and merge this before reverting pls? #98702 cc @youssef-lr
brunovjk commentedon Aug 17, 2026
Reviewing now
Beamanator commentedon Aug 17, 2026
thanks y'all! helping review and move forward
m-natarajan commentedon Aug 17, 2026
Not repro in Win11/Chrome, v9.4.54-3
Recording.3377.mp4
Beamanator commentedon Aug 17, 2026
Nice! CLosing this out!
melvin-bot commentedon Aug 18, 2026
@brunovjk
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.54-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-08-25. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]
[-]Chat - Video link disappears when editing comment for the second time[/-][+][Due for payment 2026-08-25] Chat - Video link disappears when editing comment for the second time[/+]