Skip to content

[CP Staging] Revert "Keep a file attachment intact when its comment is edited" - #101745

Merged
lakchote merged 1 commit into
mainfrom
revert-99385-fix/98743
Sep 21, 2026
Merged

lakchote merged 1 commit into
mainfrom
revert-99385-fix/98743

Conversation

@lakchote

Copy link
Copy Markdown

Reverts #99385

@lakchote
lakchote requested review from a team as code owners September 21, 2026 14:23
@melvin-bot
melvin-bot Bot requested review from dylanexpensify and removed request for a team September 21, 2026 14:23
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-21T14:32:46.428711Z d805f83 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@melvin-bot
melvin-bot Bot requested review from carlosmiceli and removed request for a team September 21, 2026 14:24
@melvin-bot

melvin-bot Bot commented Sep 21, 2026

Copy link
Copy Markdown

@carlosmiceli Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@lakchote
lakchote merged commit 54b6817 into main Sep 21, 2026
41 of 42 checks passed
@lakchote
lakchote deleted the revert-99385-fix/98743 branch September 21, 2026 14:25
@github-actions

Copy link
Copy Markdown

🚧 lakchote has triggered a test Expensify/App build. You can view the workflow run here.

@codecov

codecov Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
src/ONYXKEYS.ts 100.00% <ø> (ø)
...TMLEngineProvider/HTMLRenderers/AnchorRenderer.tsx 73.52% <100.00%> (-0.39%) ⬇️
src/libs/ExportOnyxState/common.ts 80.95% <ø> (ø)
src/libs/ReportUtils.ts 87.43% <100.00%> (-0.06%) ⬇️
src/libs/actions/Report/index.ts 72.14% <100.00%> (+0.03%) ⬆️
src/libs/actions/RequestConflictUtils.ts 100.00% <ø> (+0.86%) ⬆️
src/libs/fileDownload/FileUtils.ts 44.33% <ø> (-0.65%) ⬇️
src/libs/fileDownload/getAttachmentDetails.ts 100.00% <100.00%> (ø)
...orAttachmentsOnly/BaseAnchorForAttachmentsOnly.tsx 0.00% <0.00%> (ø)
...es/inbox/report/ContextMenu/ContextMenuActions.tsx 40.38% <0.00%> (+0.05%) ⬆️
... and 4 files with indirect coverage changes

@OSBotify

Copy link
Copy Markdown

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

OSBotify pushed a commit that referenced this pull request Sep 21, 2026
[CP Staging] Revert "Keep a file attachment intact when its comment is edited"

(cherry picked from commit 54b6817)

(cherry-picked to staging by lakchote)
@OSBotify OSBotify added the CP Staging marks PRs that have been CP'd to staging label Sep 21, 2026
@OSBotify

Copy link
Copy Markdown

🚀 Cherry-picked to staging by https://github.com/lakchote in version: 9.4.90-2 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown

🤖 No help site changes are required — I did not create a docs PR.

Why: this PR reverts Keep a file attachment intact when its comment is edited, a bug fix for Web - Chat - Attachment is displayed as a link after editing the message. It restores the previous code, so it removes a defect fix rather than changing any documented, intended behavior.

What I checked in App/docs/articles:

  • docs/articles/new-expensify/chat/Chat-Features-and-Moderation-Tools.md is the only article that covers sending attachments and the Edit comment flow. It documents how to add an attachment (L22) and how to edit or delete a message (L47-L60), but it never describes what happens to an attachment when you edit its comment.
  • No article anywhere under docs/articles documents attachment rendering after an edit, editing a comment while an upload is in flight, renaming an attachment, or the downloaded file name.

Because the help site never documented the behavior this PR reverts, there is nothing on the help site that is now wrong.

Code changes reviewed

Every file in the revert is internal implementation with no user-facing label, setting, tab, or button change:

  • src/ONYXKEYS.ts, src/libs/ExportOnyxState/common.ts, src/types/onyx/DeferredAttachmentEdits.ts — removal of the deferredAttachmentEdits Onyx key
  • src/libs/actions/Report/DeferredAttachmentEdits.ts — deleted; replayed a comment edit once its attachment finished uploading
  • src/libs/ReportUtils.ts — removal of restoreAttachmentAnchorAttributes, getUploadingAttachmentLabelFromDraft, applyLabelToUploadingAttachmentHtml, and the draft-label handling in replaceLocalAttachmentReferences
  • src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.tsx — attachment detection falls back to the data-expensify-source attribute only
  • src/components/AnchorForAttachmentsOnly/BaseAnchorForAttachmentsOnly.tsx — download name no longer passes through getDownloadFileName

If you would rather the help site call out the current attachment-on-edit behavior explicitly, reply with @MelvinBot and what you want it to say, and I will open the draft PR.


@lakchote, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR Ready for review


view run

@OSBotify

Copy link
Copy Markdown

🚀 Deployed to production by https://github.com/lakchote in version: 9.4.90-2 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

@OSBotify

Copy link
Copy Markdown

🚀 Cherry-picked to staging by https://github.com/lakchote in version: 9.4.91-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@OSBotify

Copy link
Copy Markdown

🚀 Deployed to production by https://github.com/lakchote in version: 9.4.91-3 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

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

Labels

CP Staging marks PRs that have been CP'd to staging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants