Skip to content

fix: clear attachments when switching chat profiles#2858

Merged
dokterbob merged 2 commits intoChainlit:mainfrom
Chukwuebuka-2003:fix/attachment-clear-on-profile-switch
Apr 2, 2026
Merged

fix: clear attachments when switching chat profiles#2858
dokterbob merged 2 commits intoChainlit:mainfrom
Chukwuebuka-2003:fix/attachment-clear-on-profile-switch

Conversation

@Chukwuebuka-2003
Copy link
Copy Markdown
Contributor

@Chukwuebuka-2003 Chukwuebuka-2003 commented Mar 25, 2026

Clear attachments when confirming a profile switch to prevent confusing behavior where attachments appear but aren't sent (their serverId was tied to the old session).

Fixes #2853


Summary by cubic

Clear attachments when confirming a chat profile switch to avoid showing files from the previous session that wouldn’t send. On confirm, reset attachmentsState via recoil and clear the chat session. Fixes #2853.

Written for commit a886879. Summary will update on new commits.

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working frontend Pertains to the frontend. labels Mar 25, 2026
@Chukwuebuka-2003
Copy link
Copy Markdown
Contributor Author

image 1:
image

image 2:
image

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file


Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

Copy link
Copy Markdown
Contributor

@hayescode hayescode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed via Codex

LGTM.

@Chukwuebuka-2003
Copy link
Copy Markdown
Contributor Author

Reviewed via Codex

LGTM.

@hayescode the workflow needs to be approved

Clear attachments when confirming a profile switch to prevent
confusing behavior where attachments appear but aren't sent
(their serverId was tied to the old session).

Fixes Chainlit#2853
@dokterbob dokterbob force-pushed the fix/attachment-clear-on-profile-switch branch from ac59afc to 8254ef3 Compare April 1, 2026 16:08
@dokterbob dokterbob enabled auto-merge April 1, 2026 16:08
@hayescode
Copy link
Copy Markdown
Contributor

@Chukwuebuka-2003 please address the CI then we're good to go!

@Chukwuebuka-2003
Copy link
Copy Markdown
Contributor Author

@Chukwuebuka-2003 please address the CI then we're good to go!

@hayescode can you approve the CI again? i had to update the branch

@dokterbob dokterbob added this pull request to the merge queue Apr 2, 2026
Merged via the queue into Chainlit:main with commit d008d1e Apr 2, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working frontend Pertains to the frontend. size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Attachment Lost After Profile Switch Before First Send

3 participants