mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-10 08:27:04 +00:00
LocalCache.notes is a soft cache, and a Concord rumor is decrypted exactly once per session (the community session dedups re-delivered wraps), so a kind-3302 edit left orphaned there could be GC'd on navigation and never re-downloaded — the message would silently revert to its pre-edit text. Resetting the channel EOSE doesn't help: the re-delivered wrap is swallowed by the session's isNew dedup, so its rumor never re-emits. Fix it the way reactions/replies already survive: attach the edit to the message it edits. consume(ConcordChatEditEvent) now calls target.addEdit(note), so the edit is held for exactly as long as its channel-retained message (and released with it via clearChildLinks). observeConcordEdit reads note.edits directly — author-matching, latest by CORD-02 §4 send time — instead of scanning/observing the soft cache. - Note: new hard-held `edits` collection + addEdit/removeEdit, wired into clearChildLinks like the other child-event links. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013HdLnAa4Pa1pFV9FTYVTB6