What happened?
The AI chat composer clears the entered text and saved draft before preparing the send. If image reading fails during preparation, the text is gone even though no message has reached the chat runtime.
I checked canary at 0b69a6da21e8fd35beb85667bb8496d9b3852238:
_onTextareaSend()clears the textarea and saves an empty draft before callingsend().send()reads image attachments before dispatching the user message.readBlobAsURL()rejects on a FileReader error.
In an isolated check of the existing handler and send method, forcing image reading to reject left both input and draft empty; runtime dispatch was never called. I have not reproduced this in the full application yet.
Expected: when preparation fails before dispatch, keep the pending text so the user can remove the attachment and send again. Existing retry support handles messages already received by the runtime and should stay unchanged.
Distribution version
Source inspection and isolated fault injection; not yet reproduced in an installed distribution.
App Version
canary, commit 0b69a6da21e8fd35beb85667bb8496d9b3852238 (root package version 0.27.5).
What browsers are you seeing the problem on if you're using web version?
Not tested in a browser yet.
Are you self-hosting?
No self-hosted application was used for this check.
Self-hosting Version
N/A
Relevant log output
{"error":"FileReader failed","input":"","draft":"","dispatched":false}This is the isolated check's output, not an application log.
Anything else?
I'd like to contribute a focused fix and regression test if this is a valid issue and nobody is already working on it. Proposed scope: preserve pending text on pre-dispatch preparation failure, without overwriting newer input. No new Retry button, automatic retries, backend changes, or attachment-upload recovery.
Would you welcome a PR for this scope? I'll wait for triage or your confirmation before starting implementation. Please let me know if you prefer a draft PR for review instead.
Is your content generated by AI?
This report was prepared with AI assistance. The control flow was checked against the cited source and with isolated fault injection. Full application reproduction remains pending.
Issue Status: 🆕 *Untriaged
*🆕 Untriaged
The team has not yet reviewed the issue. We usually do it within one business day. Docs: https://github.com/toeverything/AFFiNE/blob/canary/docs/issue-triaging.md
This is an automatic reply by the bot.