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-11-02] Hybrid - Chat - File name is changed into "file" after edit msg offline & back online #101744
Version Number: 9.4.90-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#99385 Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Pixel 7a/ Android 16 App Component: Chat Report View
Action Performed:
Open Hybrid app
Go to any chat
Go offline
Type some text, attach a csv file and send it.
Long tap on sent message
Select 'Edit comment'
Change the text and save it
Go online
Expected Result:
Verify the message keeps both the edited text and the file, and the file shows as a file rather than a link.
The chat card shows nothing but the anchor's own text. AnchorRenderer.tsx:45 takes the first text node and BaseAnchorForAttachmentsOnly.tsx:76 renders it with no fallback. So file is already in the HTML the server sent back, and the server names the stored attachment after the uploaded file. Something changed the filename on the wire.
Offline, the edit never sends UpdateComment. It merges into the still-queued AddTextAndAttachment, and that merge also renames the queued file — logic PR #99385 added. The rename fires whenever the draft's markdown label differs from the data-name attribute:
The guard is not idempotent.applyLabelToUploadingAttachmentHtml rewrites only the anchor's inner text and never touches data-name. Once a label changes, the two disagree permanently, so every later edit re-renames the queued file from whatever the label currently is. One bad label becomes sticky.
The rename drops the props native uploads need.renameQueuedAttachment rebuilds the object with new File([file], name, …), which silently discards the non-standard uri and source that App attaches to file objects. prepareRequestPayload/index.native.ts:55-72 keys on source; without it the request falls into the !source branch and appends a part with no uri. This is also why the report is Android app + iOS app only — web appends the persisted File as-is and never re-reads it.
Where my confidence stops: walking a first, text-only edit by hand, the draft label and data-name are equal, so the rename should not fire at all. Either the label diverges for a reason I could not see statically (the native live-markdown edit composer is the one link I could not inspect), or the multipart filename arrives blank and the backend falls back to the form-field name, which is literally file. Both funnel through the same new code, so the fix below covers either, but a maintainer should confirm which on a device before merging.
Investigation details
Why the offline case is special.editReportComment finds a queued add request and resolves the conflict as a replace instead of sending UpdateComment (Report/index.ts:3902). Online there is no queued request, so the attachment is already synced and the rename path never runs. That matches "go offline" being load-bearing in the repro.
Why "type some text" is load-bearing too.addNewMessageWithText only contains ADD_COMMENT and ADD_TEXT_AND_ATTACHMENT (Report/index.ts:490), while RequestConflictUtils also lists ADD_ATTACHMENT (:16). An attachment with no text therefore takes the deferred-replay path instead of the merge+rename path. That asymmetry looks unintentional and is worth fixing alongside.
Ruled out as the source of the string "file": there is no client-side default filename of file. CONST.DEFAULT_ATTACHMENT_FILENAME is chat_attachment; ATTACHMENT_FILE_TYPE.FILE only picks an icon; getFileName() only feeds the image/carousel paths; and ExpensiMark's html → markdown → html round trip preserves the anchor label verbatim. The only literal 'file' fallback in App source is the native paste handler in Composer/implementation/index.native.tsx, which always appends an extension and is not reachable from the picker repro.
What changes do you think we should make in order to solve the problem?
In editReportComment, compare the draft label against the attachment tag's own visible label (the thing the draft markdown was derived from), not against data-name, and treat a missing label as "no rename". This makes the check idempotent across repeated edits.
Also update data-name inside applyLabelToUploadingAttachmentHtml so the optimistic tag stays self-consistent.
Harden renameQueuedAttachment: return the file unchanged when the new name is empty, and carry uri and source across the rebuild so native uploads keep working.
Backstop in prepareRequestPayload/index.native.ts: never append a file part with an empty name — fall back to the basename of source. A missing multipart filename is what lets the backend name the attachment after the form field.
Add ADD_ATTACHMENT to addNewMessageWithText so an attachment sent without text takes the same path.
Regression tests to add: edit an offline attachment comment twice in a row and assert the queued file's name is unchanged both times, and assert uri/source survive renameQueuedAttachment. The existing test at tests/unit/RequestConflictUtilsTest.ts only asserts name and type.
What alternative solutions did you explore? (Optional)
Reverting PR #99385 and re-landing it with the rename removed. The rename only exists to make a filename change made in the editor stick; dropping it costs that one behavior and removes both defects at once. Given the PR is three days old and has produced at least two QA bugs, that may be the lower-risk option.
💡 Suggested AI code review rule
The second defect is a recurring, mechanically detectable pattern, so it may be worth a coding-standards rule so the AI reviewer catches the next one. Proposed for Expensify/App:
Rule:CONSISTENCY-18 — Preserve uri and source when rebuilding a File
Condition: Flag any new File([existingFile], …) that rebuilds a file object App already created. Re-attach the non-standard uri and source properties (for example with Object.assign), because the File constructor only copies the standard fields.
Search pattern:grep -rn "new File(\[" src/ — flag results where the first array element is an existing file object rather than a Blob or ArrayBuffer, and no uri/source is reassigned.
The full rule file would go in App/.claude/skills/app-coding-standards/. If it's worth adding, a maintainer can open it there as a draft PR.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/101744) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
You're right, and thanks for the correction. Keep a file attachment intact when its comment is edited never reached production — production is 9.4.89-0 and contains none of that PR's files — so it cannot be the cause. Here is the real one.
Proposal
What is the root cause of that problem?
react-native-nitro-fetch names an uploaded file file when the multipart part carries no filename, and on the offline path App hands it exactly that.
App swaps the global fetch for nitro-fetch on native only (src/polyfills/NitroFetch.ts:7; NitroFetch.web.ts is a no-op), and HttpUtils calls bare fetch (src/libs/HttpUtils.ts:116). Production ships react-native-nitro-fetch@1.5.4.
RN's FormData.getParts() computes the correct content-disposition header, then returns the part as {...value, headers, fieldName: name}. File.prototype.name and Blob.prototype.type are prototype getters, so the object spread drops both — only _data, source and uri survive as own properties.
nitro-fetch discards part.headers for file parts and rebuilds the disposition from that spread object: fileName: part.fileName ?? part.name ?? 'file'. Both are undefined, so the part goes out as filename="file" and the attachment is stored under that name.
Every condition in the report falls out of this:
Android app + iOS app only — web has no polyfill and uses the browser's FormData and fetch.
Offline only — an online send appends the picker's plain object, whose name and type are own properties and survive the spread.
A .csv — for an image the filename lives in alt/data-name behind a thumbnail, so a wrong name is invisible. Only a non-previewable file shows the anchor label.
This dates to 2026-07-27, when nitro-fetch became the global fetch on native.
One prediction to confirm first: the edit steps are probably not needed.initiatedOffline is stamped when the request is created (makeRequest.ts:78), and merging the edit into the queued AddTextAndAttachment leaves data.file untouched (RequestConflictUtils.ts:296). So offline → send a .csv → go online, with no edit at all should already name it file. Please try that. If it reproduces, the bug is wider than reported.
Investigation details
What I verified by reading source: the polyfill wiring and platform split; HttpUtils using bare fetch; the initiatedOffline gate; that readFileAsync produces an RN File whose only own properties are _data, source and uri; RN's spread in getParts(); nitro-fetch's 'file' default in JS and in its Kotlin and Swift uploaders; and that nothing in src/ or src/languages/en.ts emits file as a filename or label.
The one link I could not read: that the backend names the stored attachment from the multipart filename. The observed name is exactly nitro-fetch's default and no client code produces it, but this appears to be a backend behavior, so a separate internal check would confirm it.
Collateral from the same spread:type is dropped too, so nitro-fetch falls back to application/octet-stream for every offline-initiated attachment. If offline-uploaded files also come back with an octet-stream MIME type, that independently confirms the mechanism.
Why this went unnoticed: RN's own multipart builder honours part.headers, so before the nitro-fetch swap the correct filename that getParts() had already computed reached the server. Only the rebuild-from-spread path loses it.
What changes do you think we should make in order to solve the problem?
Stop handing nitro-fetch a File instance in prepareRequestPayload/index.native.ts. The native uploader only needs a plain {uri, name, type} object, and those are own properties that survive getParts()'s spread. isFileUploadable on native already only requires a string uri, so a plain object still passes validateFormDataParameter.
Add test coverage while you're there: the existing native test mocks readFileAsync to resolve null, so the FormData shape for the file key is never asserted. A test that runs the offline branch and asserts getParts() yields a part with the real name and MIME type would have caught this.
What alternative solutions did you explore? (Optional)
Make name and type own enumerable properties on the object readFileAsync returns. Plain assignment won't work — it would throw against the getter-only prototype accessor — so it needs Object.defineProperty, which is more fragile than just not using a File.
Fix serializeFormData upstream so it honours part.headers instead of rebuilding the disposition. That's the correct long-term fix and helps every consumer, but it shouldn't block this one.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/101744) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
One thing changed since my analysis:Keep a file attachment intact when its comment is edited was reverted out of main in d805f83 about half an hour ago. So on plain main this bug can't reproduce — but neither can the feature that PR added. A branch off main alone would have nothing to test.
The branch therefore has two commits, kept separate so the second reviews on its own:
Harden the rename path — the four changes from my proposal.
What the second commit changes
editReportComment decided whether an edit renamed the attachment by comparing the draft's markdown label against the data-name attribute, but applyLabelToUploadingAttachmentHtml only rewrote the anchor's inner text. Once those disagreed, every later edit re-renamed the queued file. The comparison now reads the tag's own current label through a new getUploadingAttachmentLabel helper, and applyLabelToUploadingAttachmentHtml keeps data-name in sync.
renameQueuedAttachment returns the file untouched when the label is empty. A multipart part sent with no filename is stored under the form field name, which is how an attachment ends up called file.
renameQueuedAttachment rebuilds a File to change its name, which dropped the non-standard uri and source the app hangs off file objects and that prepareRequestPayload/index.native.ts reads to find the file on disk. Both are now carried across the rebuild.
prepareRequestPayload/index.native.ts falls back to the source basename so a part is never appended unnamed.
Unit tests added for the label comparison being idempotent, for uri/source surviving the rebuild, and for an empty label leaving the queued filename alone.
Ran locally: RequestConflictUtilsTest (83 passed), ReportUtilsTest (1396 passed), ReportTest + getAttachmentDetailsTest + FileUtilsTest (363 passed), npm run typecheck, npm run lint-changed, npm run spell-changed — all pass. I did not run the full Jest suite or the Storybook smoke test.
Please re-run the repro on a device before trusting this. My analysis pinned the mechanism at medium confidence: walking a first, text-only edit by hand, the draft label and the tag label come out equal, so the rename should not fire at all. Either the label diverges inside the native live-markdown edit composer, or the multipart filename arrives blank and the server falls back to the field name. The branch closes both routes, but which one it actually was is still unconfirmed.
Two calls that are yours, not mine: whether re-landing #99385 is the right move at all versus fixing it forward separately, and whether ADD_ATTACHMENT should join addNewMessageWithText — I left that one out as a behavior change beyond this bug.
changed the title [-]Hybrid - Chat - File name is changed into "file" after edit msg offline & back online[/-][+][Due for payment 2026-11-02] Hybrid - Chat - File name is changed into "file" after edit msg offline & back online[/+]on Oct 26, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.20-5 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-11-02. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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]
Activity
applause-bot commentedon Sep 21, 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/e0589bce2f3a88f92dbdb896471e66ae1bd67ce01072f0b796d79e4bd66c9dc0
MelvinBot commentedon Sep 21, 2026
Proposal
What is the root cause of that problem?
A regression from Keep a file attachment intact when its comment is edited (merged 2026-09-18) — the same PR this bug was found while QA'ing.
The chat card shows nothing but the anchor's own text.
AnchorRenderer.tsx:45takes the first text node andBaseAnchorForAttachmentsOnly.tsx:76renders it with no fallback. Sofileis already in the HTML the server sent back, and the server names the stored attachment after the uploaded file. Something changed the filename on the wire.Offline, the edit never sends
UpdateComment. It merges into the still-queuedAddTextAndAttachment, and that merge also renames the queued file — logic PR #99385 added. The rename fires whenever the draft's markdown label differs from thedata-nameattribute:src/libs/actions/Report/index.ts:3788-3792→RequestConflictUtils.ts:316-320Two defects in that path:
applyLabelToUploadingAttachmentHtmlrewrites only the anchor's inner text and never touchesdata-name. Once a label changes, the two disagree permanently, so every later edit re-renames the queued file from whatever the label currently is. One bad label becomes sticky.renameQueuedAttachmentrebuilds the object withnew File([file], name, …), which silently discards the non-standarduriandsourcethat App attaches to file objects.prepareRequestPayload/index.native.ts:55-72keys onsource; without it the request falls into the!sourcebranch and appends a part with nouri. This is also why the report is Android app + iOS app only — web appends the persistedFileas-is and never re-reads it.Where my confidence stops: walking a first, text-only edit by hand, the draft label and
data-nameare equal, so the rename should not fire at all. Either the label diverges for a reason I could not see statically (the native live-markdown edit composer is the one link I could not inspect), or the multipart filename arrives blank and the backend falls back to the form-field name, which is literallyfile. Both funnel through the same new code, so the fix below covers either, but a maintainer should confirm which on a device before merging.Investigation details
Why the offline case is special.
editReportCommentfinds a queued add request and resolves the conflict as areplaceinstead of sendingUpdateComment(Report/index.ts:3902). Online there is no queued request, so the attachment is already synced and the rename path never runs. That matches "go offline" being load-bearing in the repro.Why "type some text" is load-bearing too.
addNewMessageWithTextonly containsADD_COMMENTandADD_TEXT_AND_ATTACHMENT(Report/index.ts:490), whileRequestConflictUtilsalso listsADD_ATTACHMENT(:16). An attachment with no text therefore takes the deferred-replay path instead of the merge+rename path. That asymmetry looks unintentional and is worth fixing alongside.Ruled out as the source of the string "file": there is no client-side default filename of
file.CONST.DEFAULT_ATTACHMENT_FILENAMEischat_attachment;ATTACHMENT_FILE_TYPE.FILEonly picks an icon;getFileName()only feeds the image/carousel paths; and ExpensiMark's html → markdown → html round trip preserves the anchor label verbatim. The only literal'file'fallback in App source is the native paste handler inComposer/implementation/index.native.tsx, which always appends an extension and is not reachable from the picker repro.Possibly related: Chat- Attachment is empty when edit msg while file is loading — another "edit a comment while its attachment is still uploading" failure, likely from the same PR. Worth fixing together.
What changes do you think we should make in order to solve the problem?
editReportComment, compare the draft label against the attachment tag's own visible label (the thing the draft markdown was derived from), not againstdata-name, and treat a missing label as "no rename". This makes the check idempotent across repeated edits.data-nameinsideapplyLabelToUploadingAttachmentHtmlso the optimistic tag stays self-consistent.renameQueuedAttachment: return the file unchanged when the new name is empty, and carryuriandsourceacross the rebuild so native uploads keep working.prepareRequestPayload/index.native.ts: never append a file part with an empty name — fall back to the basename ofsource. A missing multipart filename is what lets the backend name the attachment after the form field.ADD_ATTACHMENTtoaddNewMessageWithTextso an attachment sent without text takes the same path.Regression tests to add: edit an offline attachment comment twice in a row and assert the queued file's name is unchanged both times, and assert
uri/sourcesurviverenameQueuedAttachment. The existing test attests/unit/RequestConflictUtilsTest.tsonly assertsnameandtype.What alternative solutions did you explore? (Optional)
Reverting PR #99385 and re-landing it with the rename removed. The rename only exists to make a filename change made in the editor stick; dropping it costs that one behavior and removes both defects at once. Given the PR is three days old and has produced at least two QA bugs, that may be the lower-risk option.
💡 Suggested AI code review rule
The second defect is a recurring, mechanically detectable pattern, so it may be worth a coding-standards rule so the AI reviewer catches the next one. Proposed for
Expensify/App:CONSISTENCY-18— Preserveuriandsourcewhen rebuilding aFilenew File([existingFile], …)that rebuilds a file object App already created. Re-attach the non-standarduriandsourceproperties (for example withObject.assign), because theFileconstructor only copies the standard fields.sourceandurioff the file object; a rebuild that drops them silently changes the upload path. This is what broke [Due for payment 2026-11-02] Hybrid - Chat - File name is changed into "file" after edit msg offline & back online #101744.grep -rn "new File(\[" src/— flag results where the first array element is an existing file object rather than aBloborArrayBuffer, and nouri/sourceis reassigned.RequestConflictUtils.ts:282-289TransactionReceiptModalContent.tsx:327andFileUtils.ts:915, which both re-attachuri/sourceafter the rebuildThe full rule file would go in
App/.claude/skills/app-coding-standards/. If it's worth adding, a maintainer can open it there as a draft PR.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/101744)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
melvin-bot commentedon Sep 21, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @shubham1206agra (
External)melvin-bot commentedon Sep 21, 2026
Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.
shubham1206agra commentedon Sep 21, 2026
@MelvinBot The PR was reverted and the issue is reproducible on production.
mukhrr commentedon Sep 21, 2026
@lakchote can you pls assign me here? thanks
MelvinBot commentedon Sep 21, 2026
You're right, and thanks for the correction. Keep a file attachment intact when its comment is edited never reached production — production is 9.4.89-0 and contains none of that PR's files — so it cannot be the cause. Here is the real one.
Proposal
What is the root cause of that problem?
react-native-nitro-fetchnames an uploaded filefilewhen the multipart part carries no filename, and on the offline path App hands it exactly that.fetchfor nitro-fetch on native only (src/polyfills/NitroFetch.ts:7;NitroFetch.web.tsis a no-op), andHttpUtilscalls barefetch(src/libs/HttpUtils.ts:116). Production shipsreact-native-nitro-fetch@1.5.4.Fileinstance (src/libs/prepareRequestPayload/index.native.ts:55-71, viareadFileAsyncinFileUtils.ts:294-298).FormData.getParts()computes the correctcontent-dispositionheader, then returns the part as{...value, headers, fieldName: name}.File.prototype.nameandBlob.prototype.typeare prototype getters, so the object spread drops both — only_data,sourceandurisurvive as own properties.part.headersfor file parts and rebuilds the disposition from that spread object:fileName: part.fileName ?? part.name ?? 'file'. Both areundefined, so the part goes out asfilename="file"and the attachment is stored under that name.Every condition in the report falls out of this:
FormDataandfetch.nameandtypeare own properties and survive the spread.alt/data-namebehind a thumbnail, so a wrong name is invisible. Only a non-previewable file shows the anchor label.file—CONST.DEFAULT_ATTACHMENT_FILENAMEischat_attachment, and the chat card renders the anchor's own text with no fallback (AnchorRenderer.tsx:42→BaseAnchorForAttachmentsOnly.tsx:75).This dates to 2026-07-27, when nitro-fetch became the global
fetchon native.One prediction to confirm first: the edit steps are probably not needed.
initiatedOfflineis stamped when the request is created (makeRequest.ts:78), and merging the edit into the queuedAddTextAndAttachmentleavesdata.fileuntouched (RequestConflictUtils.ts:296). So offline → send a .csv → go online, with no edit at all should already name itfile. Please try that. If it reproduces, the bug is wider than reported.Investigation details
What I verified by reading source: the polyfill wiring and platform split;
HttpUtilsusing barefetch; theinitiatedOfflinegate; thatreadFileAsyncproduces an RNFilewhose only own properties are_data,sourceanduri; RN's spread ingetParts(); nitro-fetch's'file'default in JS and in its Kotlin and Swift uploaders; and that nothing insrc/orsrc/languages/en.tsemitsfileas a filename or label.The one link I could not read: that the backend names the stored attachment from the multipart
filename. The observed name is exactly nitro-fetch's default and no client code produces it, but this appears to be a backend behavior, so a separate internal check would confirm it.Collateral from the same spread:
typeis dropped too, so nitro-fetch falls back toapplication/octet-streamfor every offline-initiated attachment. If offline-uploaded files also come back with an octet-stream MIME type, that independently confirms the mechanism.Why this went unnoticed: RN's own multipart builder honours
part.headers, so before the nitro-fetch swap the correct filename thatgetParts()had already computed reached the server. Only the rebuild-from-spread path loses it.Related issues. [Exploratory] Chat - Doc file border and download icon missing after edit comment. is the separate, still-open production bug that PR #99385 was written to fix (an edited attachment degrades to a plain link) — a different symptom in the same flow, and untouched by this. Chat - Edited file name is not saved when editing file name in offline mode is the closed prior report of the same repro shape. Attachment-Both CSV files become misaligned after editing the second CSV, Chat- Attachment is empty when edit msg while file is loading and Attachment-File becomes misaligned after renaming; LHN shows renamed file name were all marked not reproducible in production and should be resolved by the revert.
What changes do you think we should make in order to solve the problem?
Stop handing nitro-fetch a
Fileinstance inprepareRequestPayload/index.native.ts. The native uploader only needs a plain{uri, name, type}object, and those are own properties that survivegetParts()'s spread.isFileUploadableon native already only requires a stringuri, so a plain object still passesvalidateFormDataParameter.Add test coverage while you're there: the existing native test mocks
readFileAsyncto resolvenull, so the FormData shape for thefilekey is never asserted. A test that runs the offline branch and assertsgetParts()yields a part with the real name and MIME type would have caught this.What alternative solutions did you explore? (Optional)
nameandtypeown enumerable properties on the objectreadFileAsyncreturns. Plain assignment won't work — it would throw against the getter-only prototype accessor — so it needsObject.defineProperty, which is more fragile than just not using aFile.serializeFormDataupstream so it honourspart.headersinstead of rebuilding the disposition. That's the correct long-term fix and helps every consumer, but it shouldn't block this one.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/101744)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
shubham1206agra commentedon Sep 21, 2026
@MelvinBot Give me a test branch please
mukhrr commentedon Sep 21, 2026
@shubham1206agra this is what we should have fixed in original PR and not paid. I will handle this
MelvinBot commentedon Sep 21, 2026
Test branch is up: [Test branch] Keep an edited attachment name from collapsing to the form field name — draft, assigned to
shubham1206agra, branchclaude-attachmentNameResetOnOfflineEdit.One thing changed since my analysis: Keep a file attachment intact when its comment is edited was reverted out of
mainind805f83about half an hour ago. So on plainmainthis bug can't reproduce — but neither can the feature that PR added. A branch offmainalone would have nothing to test.The branch therefore has two commits, kept separate so the second reviews on its own:
What the second commit changes
editReportCommentdecided whether an edit renamed the attachment by comparing the draft's markdown label against thedata-nameattribute, butapplyLabelToUploadingAttachmentHtmlonly rewrote the anchor's inner text. Once those disagreed, every later edit re-renamed the queued file. The comparison now reads the tag's own current label through a newgetUploadingAttachmentLabelhelper, andapplyLabelToUploadingAttachmentHtmlkeepsdata-namein sync.renameQueuedAttachmentreturns the file untouched when the label is empty. A multipart part sent with no filename is stored under the form field name, which is how an attachment ends up calledfile.renameQueuedAttachmentrebuilds aFileto change its name, which dropped the non-standarduriandsourcethe app hangs off file objects and thatprepareRequestPayload/index.native.tsreads to find the file on disk. Both are now carried across the rebuild.prepareRequestPayload/index.native.tsfalls back to thesourcebasename so a part is never appended unnamed.Unit tests added for the label comparison being idempotent, for
uri/sourcesurviving the rebuild, and for an empty label leaving the queued filename alone.Ran locally:
RequestConflictUtilsTest(83 passed),ReportUtilsTest(1396 passed),ReportTest+getAttachmentDetailsTest+FileUtilsTest(363 passed),npm run typecheck,npm run lint-changed,npm run spell-changed— all pass. I did not run the full Jest suite or the Storybook smoke test.Please re-run the repro on a device before trusting this. My analysis pinned the mechanism at medium confidence: walking a first, text-only edit by hand, the draft label and the tag label come out equal, so the rename should not fire at all. Either the label diverges inside the native live-markdown edit composer, or the multipart filename arrives blank and the server falls back to the field name. The branch closes both routes, but which one it actually was is still unconfirmed.
Two calls that are yours, not mine: whether re-landing #99385 is the right move at all versus fixing it forward separately, and whether
ADD_ATTACHMENTshould joinaddNewMessageWithText— I left that one out as a behavior change beyond this bug.view run
7 remaining items
melvin-bot commentedon Oct 12, 2026
@shubham1206agra Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!
shubham1206agra commentedon Oct 14, 2026
Still working on it
melvin-bot commentedon Oct 21, 2026
@shubham1206agra Whoops! This issue is 2 days overdue. Let's get this updated quick!
shubham1206agra commentedon Oct 22, 2026
@mukhrr Status please
mukhrr commentedon Oct 22, 2026
still working on it
[-]Hybrid - Chat - File name is changed into "file" after edit msg offline & back online[/-][+][Due for payment 2026-11-02] Hybrid - Chat - File name is changed into "file" after edit msg offline & back online[/+]melvin-bot commentedon Oct 26, 2026
@shubham1206agra
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.20-5 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-11-02. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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]
mukhrr commentedon Oct 27, 2026
I thinh we can skip payment here per #101744 (comment)oh wait this seems to be pre-existing and per #101744 (comment)and I was wrong here. This is not we should have fixed with original issue
But still, I think, we can skip payment here and generalize amount on #98743 to be paid
melvin-bot commentedon Oct 27, 2026
@shubham1206agra Eep! 4 days overdue now. Issues have feelings too...
shubham1206agra commentedon Oct 28, 2026
Since this is fixed and no one is going to be paid here. I am going to close this.