fix(desktop): avoid drafts from persistent agent hydration - #3900
fix(desktop): avoid drafts from persistent agent hydration#3900MajorTal wants to merge 1 commit into
Conversation
|
good catch on hydration drafts. does the same path fire for persona reloads after reconnect, or only the initial managed-agent hydrate? |
|
Good question! The fix covers the exact composer state created by persistent-agent hydration, including after sending. A persona reload on the same thread does not trigger hydration by itself, but if reconnecting remounts the composer, it goes through the same protected path. I do not have a reconnect-specific test yet, so happy to add one if there is another path I missed. |
b3fade7 to
09c8b7d
Compare
09c8b7d to
f3dfc3d
Compare
Signed-off-by: Tal Weiss <major.tal@gmail.com>
f3dfc3d to
1b44b46
Compare
|
Closing this as superseded by #6315, which merged yesterday. That PR rebuilt the persistent-agent-audience feature and deleted More to the point, the bug looks designed out rather than fixed. The mechanism here was that hydration wrote agent mentions into the composer content, so After #6315, addressed agents live in a separate address tray — Removing the mechanism beats compensating for it, so this is the better outcome. Thanks @Chessing234 for the review here — the keyboard-open case you asked about is moot under the new design for the same reason. One caveat worth stating plainly: this is a code read, not a reproduction. I can't run the desktop app against a live relay to confirm the symptom is gone, so I've commented on #3376 rather than assuming it can be closed. |
Hey good people, I'm Tal and this is my first contribution to this (awesome) project. It's a bug that was bothering me while dogfooding Buzz. I hope it's in good order...
Summary
Opening a thread with Keep addressed agents active enabled hydrated the composer with programmatic agent mentions. When the thread unmounted, the normal draft lifecycle serialized those mentions as if the user had authored them, creating an Inbox draft without any user input.
This change records the exact editor state produced by persistent-agent hydration and resolves only that unchanged state to empty content when persisting a draft. Any user edit makes the content differ and is preserved normally. Existing mention-only drafts, attachment-only drafts, thread switches, and the post-send recipient state are covered by regression tests.
User impact: viewing a thread no longer creates a ghost draft, while real unsent content and attachments continue to be saved.
Related issue
Fixes #3376.
No duplicate open PRs were found for this issue.
Testing
. ./bin/activate-hermit && just ciMessageComposerDraftImagePersist.test.mjspersistent-agent-audience.spec.ts, including the full open-thread/leave-thread draft regressionManual verification:
There is no visual or layout change, so a before/after screenshot would be identical; this PR changes only draft-persistence behavior.