Skip to content

[Due for payment 2026-02-26] AI - Send button is unresponsive when post image in concierge RHP #82291

Closed

Description

@lanitochka17

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.3.18-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/folder/22315296/test-cases/56016282
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation (hyperlinked to channel name):

Action Performed:

Precondition: resize browser window to 2/3 of fullsize.

  1. Navigate to NewDot
  2. Create a fresh test account (email without "+", select manage my team's expense and QBD)
  3. When RHP with Concierge chat opens > Upload a clear receipt image
  4. Click Send

Expected Result:

Image is posted in chat

Actual Result:

Nothing happens. Button is unresponsive
In DevTools console an error appears

Workaround:

Unknown

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Bug7076054_1770916649269.Screen_Recording_2026-02-12_at_18.58.46.1.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @trjExpensify

Activity

  1. added
    External
    Daily
    Bug
    on Feb 12, 2026
  2. added
    Help Wanted
    on Feb 12, 2026
  3. melvin-bot commented on Feb 12, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @linhvovan29546 (External)

  4. melvin-bot commented on Feb 12, 2026

    @melvin-bot

    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.

  5. melvin-bot commented on Feb 12, 2026

    @melvin-bot

    Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.

  6. daledah commented on Feb 12, 2026

    @daledah
    Contributor

    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_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:

    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.');
    }
    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)

    N/A

  7. PiyushChandra17 commented on Feb 12, 2026

    @PiyushChandra17
    Contributor

    🚨 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

    1. Initially when Conceirge RHP opens, composerRef.current?.clearWorklet is falsy value for a short while > composerRef is null

    2. Then composerRef.current?.clearWorklet becomes true > composerRef is not null

    3. Then on Conceirge Chat RHP > when we tap on "+" > "Add attachment" > select receipt > "Tap on Send button"

    4. 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:

    1. We can handle the case gracefully, guard against the undefined instead of throwing an error, add console.warn('clearWorklet is not ready') and return
    const addAttachment = useCallback((file: FileObject | FileObject[]) => {
        attachmentFileRef.current = file;
    
        const clearWorklet = composerRef.current?.clearWorklet;
    
        if (!clearWorklet) {
            console.warn('clearWorklet not ready, clearing composer via fallback');
            return;
        }
    
        scheduleOnUI(clearWorklet);
    }, []);
    1. OR Queue the operation: Store the operation and execute it once when clearWorklet is ready or true or not undefined
    const addAttachment = useCallback((file: FileObject | FileObject[]) => {
        attachmentFileRef.current = file;
    
        const clearWorklet = composerRef.current?.clearWorklet;
    
        if (!clearWorklet) {
            // Queue for next frame
            requestAnimationFrame(() => 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.

  8. annaweber830 commented on Feb 12, 2026

    @annaweber830
    Contributor

    🚨 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:

    1. Keep setting attachmentFileRef.current = file.
    2. If clearWorklet exists, use existing behavior (scheduleOnUI(clearWorklet)), which clears composer and triggers normal onClear -> submitForm(text) flow.
    3. If clearWorklet is missing, fallback to direct submit using JS:
    • read text via composerRef.current?.getCurrentText() ?? ''
    • call submitForm(currentText) directly
    • do not throw.
    const addAttachment = useCallback((file) => {
        attachmentFileRef.current = file;
    
        const clearWorklet = composerRef.current?.clearWorklet;
        if (clearWorklet) {
            scheduleOnUI(clearWorklet);
            return;
        }
    
        // Fallback path: submit from JS if worklet ref isn't ready yet
        submitForm(composerRef.current?.getCurrentText() ?? '');
    }, [submitForm]);
    

    What alternative solutions did you explore? (Optional)

  9. linhvovan29546 commented on Feb 13, 2026

    @linhvovan29546
    Contributor

    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?

    throw new Error('The composerRef.clearWorklet function is not set yet. This should never happen, and indicates a developer error.');

  10. PiyushChandra17 commented on Feb 13, 2026

    @PiyushChandra17
    Contributor

    @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 not undefined.

    Add attachment Conceirge Page

    Image

    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

    Add attachment Concierge RHP

    Image

    cc @trjExpensify

  11. 16 remaining items

  12. added
    Awaiting Payment
    on Feb 19, 2026
  13. 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
  14. removed
    Reviewing
    on Feb 19, 2026
  15. melvin-bot commented on Feb 19, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  16. melvin-bot commented on Feb 19, 2026

    @melvin-bot

    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:

  17. melvin-bot commented on Feb 19, 2026

    @melvin-bot

    @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]

  18. linhvovan29546 commented on Feb 26, 2026

    @linhvovan29546
    Contributor

    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:

    1. Open ND.
    2. Click the Concierge button in the header to open the side panel.
    3. When RHP with Concierge chat opens > Upload an attachment.
    4. Click Send.
    5. Verify the attachment is sent.
    6. Open that attachment.
    7. Verify the attachment opens successfully.

    Do we agree 👍 or 👎

  19. added
    Daily
    and removed
    Weekly
    on Feb 26, 2026
  20. trjExpensify commented on Mar 2, 2026

    @trjExpensify
    Contributor

    Thanks! Payment summary as follows:

    Offers sent in Upwork!

  21. trjExpensify commented on Mar 2, 2026

    @trjExpensify
    Contributor

    Paid both, closing!

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions