mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-06 03:38:23 +00:00
The announced name was fetched by hand, parsed by hand, deduped by hand, kept in a second map on CordnRuntime and pruned by hand on stop/forget/purge -- and was still unverified, because verification is one more thing the cache does and a hand-rolled path does not. The reason given for all of it was that ServerAnnouncement is a parser over a raw Event "with no registered event class, so nothing caches one". That was backwards: nothing cached one BECAUSE no class was registered. EventCache says so itself, above the group this now joins -- "New kinds without custom consume logic go in one of the two groups below -- an unlisted kind falls into the else branch and is rejected as unsupported." So the kinds are typed and listed: CvmServerAnnouncementEvent (11316) and CvmToolsListEvent (11317), both BaseReplaceableEvent, registered in EventFactory and added to EventCache's replaceable group. From there the cache does what it does for every other kind -- stores it, keeps the newest per (kind, pubkey) because these kinds are replaceable, and verifies before anything trusts it (wasVerified || justVerify) -- and the screens read the name off the cached note through observeNoteEvent, the same event-finder data source the rest of the app uses. Deleted, because the cache replaces all of it: CordnRuntime.announcedNames and its three pruning sites, announcedServerName with its hand-rolled newest-wins, author filter and injectable verify, that function's test file, and the announced-name plumbing through both screens' call sites. The prefetch stays, but only to aim the request at the coordinator's own relays -- the one thing the generic data sources cannot know until its relay list is cached. Also drops the raw hex from Technical details. A profile shows a short npub with a button that copies the full one and then the same for the nprofile (DrawAdditionalInfo); nothing user-facing in this app shows 64 hex characters, and there was no reason for a coordinator to be the exception -- the argument that refs and device documents speak hex was about the wire encoding, not about what a person should read. The nprofile earns its place here more than on a profile, since its relay hints are how a coordinator is reached at all. Still to do: CordnCoordinatorDiscovery reads surfaces off a raw sweep for unknown servers and needs relay attribution, so it keeps its own path -- and its own verification, which it still lacks. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012BfD4txdnsaPRXmNXbup9n