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-02-26] AI - Send button is unresponsive when post image in concierge RHP #82291
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 contributor
Please re-state the problem that we are trying to solve in this issue.
Nothing happens when clicking the Send button in the attachment modal. The button is unresponsive and a developer error appears in DevTools console: "The composerRef.clearWorklet function is not set yet. This should never happen, and indicates a developer error."
What is the root cause of that problem?
When the attachment modal opens (navigating to REPORT_ADD_ATTACHMENT route), the ReportActionCompose component's composerRef may not be properly initialized or the ComposerWithSuggestions component may not be mounted yet.
When the user clicks the Send button, the addAttachment callback is invoked, which immediately tries to access composerRef.current?.clearWorklet. If the ref is not set, it throws an error instead of gracefully handling the situation:
thrownewError('The composerRef.clearWorklet function is not set yet. This should never happen, and indicates a developer error.');
}
scheduleOnUI(clearWorklet);
},[]);
The clearWorklet function is used to clear the composer input text on the UI thread, but it should not be a blocker for sending attachments.
What changes do you think we should make in order to solve the problem?
Instead of throwing an error when clearWorklet is not available, we should gracefully handle this case and still allow the attachment to be sent. The clearing of the composer input is a nice-to-have but not critical for the attachment upload flow.
diff --git a/src/pages/inbox/report/ReportActionCompose/ReportActionCompose.tsx b/src/pages/inbox/report/ReportActionCompose/ReportActionCompose.tsx--- a/src/pages/inbox/report/ReportActionCompose/ReportActionCompose.tsx+++ b/src/pages/inbox/report/ReportActionCompose/ReportActionCompose.tsx@@ -311,12 +311,10 @@ function ReportActionCompose({
const addAttachment = useCallback((file: FileObject | FileObject[]) => {
attachmentFileRef.current = file;
const clearWorklet = composerRef.current?.clearWorklet;
- if (!clearWorklet) {- throw new Error('The composerRef.clearWorklet function is not set yet. This should never happen, and indicates a developer error.');+ if (clearWorklet) {+ scheduleOnUI(clearWorklet);
}
-- scheduleOnUI(clearWorklet);
}, []);
What alternative solutions did you explore? (Optional)
🚨 Edited by proposal-police: This proposal was edited at 2026-02-12 19:05:09 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
AI - Send button is unresponsive when post image in concierge RHP
What is the root cause of that problem?
The root cause is that Add attachement is being called before composerRef.current?.clearWorklet function has been initialized
Initially when Conceirge RHP opens, composerRef.current?.clearWorklet is falsy value for a short while > composerRef is null
Then composerRef.current?.clearWorklet becomes true > composerRef is not null
Then on Conceirge Chat RHP > when we tap on "+" > "Add attachment" > select receipt > "Tap on Send button"
When we tap "Send Button" > clearWorklet is undefined means composerRef is null
Whats happening here is composerRef.current?.clearWorklet is becomes false again
What changes do you think we should make in order to solve the problem?
There are two ways we can handle this:
We can handle the case gracefully, guard against the undefined instead of throwing an error, add console.warn('clearWorklet is not ready') and return
constaddAttachment=useCallback((file: FileObject|FileObject[])=>{attachmentFileRef.current=file;constclearWorklet=composerRef.current?.clearWorklet;if(!clearWorklet){console.warn('clearWorklet not ready, clearing composer via fallback');return;}scheduleOnUI(clearWorklet);},[]);
OR Queue the operation: Store the operation and execute it once when clearWorklet is ready or true or not undefined
constaddAttachment=useCallback((file: FileObject|FileObject[])=>{attachmentFileRef.current=file;constclearWorklet=composerRef.current?.clearWorklet;if(!clearWorklet){// Queue for next framerequestAnimationFrame(()=>addAttachment(file));return;}scheduleOnUI(clearWorklet);},[]);
What alternative solutions did you explore? (Optional)
Result:
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
🚨 Edited by proposal-police: This proposal was edited at 2026-02-12 22:38:59 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user uploads an image receipt in the Concierge chat inside the right-hand pane and then clicks the Send button, the message is not sent. The button appears unresponsive and a console error is thrown, so users cannot post the uploaded image from this flow.
What is the root cause of that problem?
The attachment modal send flow uses onConfirm -> addAttachment(). In addAttachment(), we currently treat missing composerRef.current?.clearWorklet as fatal and throw.
That assumption is incorrect in this route because composerRef / clearWorklet may not be ready at that moment (timing/mount race), especially in responsive RHP/modal transitions. Throwing aborts the flow before submitForm() can run, so the attachment never sends.
What changes do you think we should make in order to solve the problem?
Make addAttachment() resilient:
Keep setting attachmentFileRef.current = file.
If clearWorklet exists, use existing behavior (scheduleOnUI(clearWorklet)), which clears composer and triggers normal onClear -> submitForm(text) flow.
If clearWorklet is missing, fallback to direct submit using JS:
read text via composerRef.current?.getCurrentText() ?? ''
Thank you everyone for proposals. Please check this error message: The composerRef.clearWorklet function is not set yet. This should never happen, and indicates a developer error. This should never happen, if it does, why does it occur in the Concierge RHP but not when adding an attachment directly on the Concierge page?
@linhvovan29546 When adding an Attachment directly on Conceirge page, Add attachment is being called after the composerRef.current?.clearWorklet function has been initialized as a result clearWorklet is notundefined.
Add attachment Conceirge Page
However thats not the case when we send the Attachment on Conceirge RHP page, here Add attachment is called before the composerRef.current?.clearWorklet function has been initialized as a result clearWorklet is undefined
changed the title [-]AI - Send button is unresponsive when post image in concierge RHP[/-][+][Due for payment 2026-02-26] AI - Send button is unresponsive when post image in concierge RHP[/+]on Feb 19, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.22-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@linhvovan29546@trjExpensify The PR fixing this issue has been merged! 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]
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
-Resize browser to less than 1300px or test on mweb.
Test:
Open ND.
Click the Concierge button in the header to open the side panel.
When RHP with Concierge chat opens > Upload an attachment.
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 contributor
Activity
melvin-bot commentedon Feb 12, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @linhvovan29546 (
External)melvin-bot commentedon Feb 12, 2026
Triggered auto assignment to @trjExpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.melvin-bot commentedon Feb 12, 2026
Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.
daledah commentedon Feb 12, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
Nothing happens when clicking the Send button in the attachment modal. The button is unresponsive and a developer error appears in DevTools console: "The composerRef.clearWorklet function is not set yet. This should never happen, and indicates a developer error."
What is the root cause of that problem?
When the attachment modal opens (navigating to
REPORT_ADD_ATTACHMENTroute), theReportActionComposecomponent'scomposerRefmay not be properly initialized or theComposerWithSuggestionscomponent may not be mounted yet.When the user clicks the Send button, the
addAttachmentcallback is invoked, which immediately tries to accesscomposerRef.current?.clearWorklet. If the ref is not set, it throws an error instead of gracefully handling the situation:App/src/pages/inbox/report/ReportActionCompose/ReportActionCompose.tsx
Lines 311 to 321 in b529010
The
clearWorkletfunction is used to clear the composer input text on the UI thread, but it should not be a blocker for sending attachments.What changes do you think we should make in order to solve the problem?
Instead of throwing an error when
clearWorkletis not available, we should gracefully handle this case and still allow the attachment to be sent. The clearing of the composer input is a nice-to-have but not critical for the attachment upload flow.What alternative solutions did you explore? (Optional)
N/A
PiyushChandra17 commentedon Feb 12, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-02-12 19:05:09 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
AI - Send button is unresponsive when post image in concierge RHP
What is the root cause of that problem?
The root cause is that
Add attachementis being called beforecomposerRef.current?.clearWorkletfunction has been initializedInitially when
Conceirge RHPopens,composerRef.current?.clearWorkletisfalsyvalue for a short while >composerRefisnullThen
composerRef.current?.clearWorkletbecomestrue>composerRefis notnullThen on
Conceirge Chat RHP> when we tap on "+" > "Add attachment" > select receipt > "Tap on Send button"When we tap "Send Button" >
clearWorkletisundefinedmeanscomposerRefis nullWhats happening here is
composerRef.current?.clearWorkletis becomesfalseagainWhat changes do you think we should make in order to solve the problem?
There are two ways we can handle this:
undefinedinstead of throwing an error, addconsole.warn('clearWorklet is not ready')andreturnclearWorkletis ready or true or notundefinedWhat alternative solutions did you explore? (Optional)
Result:
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
annaweber830 commentedon Feb 12, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-02-12 22:38:59 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user uploads an image receipt in the Concierge chat inside the right-hand pane and then clicks the Send button, the message is not sent. The button appears unresponsive and a console error is thrown, so users cannot post the uploaded image from this flow.
What is the root cause of that problem?
The attachment modal send flow uses onConfirm -> addAttachment(). In addAttachment(), we currently treat missing composerRef.current?.clearWorklet as fatal and throw.
That assumption is incorrect in this route because composerRef / clearWorklet may not be ready at that moment (timing/mount race), especially in responsive RHP/modal transitions. Throwing aborts the flow before submitForm() can run, so the attachment never sends.
What changes do you think we should make in order to solve the problem?
Make addAttachment() resilient:
What alternative solutions did you explore? (Optional)
linhvovan29546 commentedon Feb 13, 2026
Thank you everyone for proposals. Please check this error message:
The composerRef.clearWorklet function is not set yet. This should never happen, and indicates a developer error. This should never happen, if it does, why does it occur in theConcierge RHPbut not when adding an attachment directly on theConciergepage?App/src/pages/inbox/report/ReportActionCompose/ReportActionCompose.tsx
Line 317 in 4e0897a
PiyushChandra17 commentedon Feb 13, 2026
@linhvovan29546 When adding an
Attachmentdirectly onConceirgepage,Add attachmentis being calledafterthecomposerRef.current?.clearWorkletfunction has been initialized as a resultclearWorkletis notundefined.Add attachment Conceirge Page
However thats not the case when we send the
AttachmentonConceirge RHPpage, hereAdd attachmentis calledbeforethecomposerRef.current?.clearWorkletfunction has been initialized as a resultclearWorkletisundefinedAdd attachment Concierge RHP
cc @trjExpensify
16 remaining items
[-]AI - Send button is unresponsive when post image in concierge RHP[/-][+][Due for payment 2026-02-26] AI - Send button is unresponsive when post image in concierge RHP[/+]melvin-bot commentedon Feb 19, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Feb 19, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.22-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-02-26. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Feb 19, 2026
@linhvovan29546 @trjExpensify The PR fixing this issue has been merged! 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]
linhvovan29546 commentedon Feb 26, 2026
BugZero Checklist:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: https://github.com/Expensify/App/pull/76277/changes#r2856555646
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
-Resize browser to less than 1300px or test on mweb.
Test:
Conciergebutton in the header to open the side panel.Do we agree 👍 or 👎
trjExpensify commentedon Mar 2, 2026
Thanks! Payment summary as follows:
Offers sent in Upwork!
trjExpensify commentedon Mar 2, 2026
Paid both, closing!