Files
amethyst/commons
Claude 647997f895 refactor(buzz): audit pass — fix draft-save invite bug, races, GC churn
Batch of correctness, performance, and code-quality fixes across the Buzz
workspace feature surfaced by a full audit of the branch's modified files:

- ChannelNewMessageViewModel: agent auto-invite ran inside createTemplate(),
  which sendDraftSync() calls per keystroke — so @mentioning a member
  published real kind-9000 invites while still typing. Move the invite to the
  send path (sendPostSync) and stage the pending mentions instead.
- AgentConsoleViewModel: fix a decryptCache read/reload race by guarding
  reloadFromCache (not refresh) under the mutex; bound observerSeen growth.
- BuzzNewDmViewModel: broaden start()'s catch so signer/IO/timeout failures
  surface as an error instead of leaving Start stuck on "Sending"; rethrow
  CancellationException.
- BuzzPresenceState / BuzzAgentActivityState: replace per-record full-map
  copies with persistent maps (structural sharing) to cut GC churn; the
  StateFlow now holds the map directly.
- RelayGroupChannelListScreen / RelayGroupMembersScreen / RelayGroupTopBar /
  RenderBuzzNotes: correct remember/LaunchedEffect keys so state rebinds when
  the relay or channel changes.
- RelayGroupDiscoveryFeedFilter: hoist joinedGroupIds() out of the per-item
  matches() loop.
- RelayGroupChannel / BuzzWorkspaceStates: @Volatile the fields read off relay
  dispatcher threads.
- BuzzInviteMinter: build the request URL through HttpUrl.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J8KBSw6smQRyXLiWHeDsZ8
2026-07-23 16:32:26 +00:00
..