Checkpoint: DRY relay fan-out

This commit is contained in:
Avi 2026-08-24 22:12:12 -05:00
commit 40ec9a0dfa

View file

@ -1,4 +1,57 @@
# Checkpoint — NIP-46 signer handshake fix (2026-08-24)
# Checkpoint — DRY relay fan-out (2026-08-24)
A stopping point you can return to if this session is closed. Everything below was
verified green at the moment this file was written.
## Where things are
- Project: `/home/avi/Projects/Nostr_Keynctr`
- Git repo: `master` @ `1c428a9` ("DRY: single parallel relay fan-out for notes
and metadata"). Before it: `64ad94d` (NIP-46 handshake fix), `b21678f`/
`ae84526` (checkpoints), `dd50b24` (Aurora rename).
- Working tree: clean apart from this checkpoint update. `concept3.svg` deleted
and `KeynectrAppIconPossibility02.jpeg` untracked remain as the user had them.
## What was completed
1. **R1 DRY refactor (`1c428a9`).** The parallel relay send block (~55 lines:
JoinSet per-relay sends, 6 s timeout, indexed outcome collection,
disconnect, succeeded/failed split) existed twice — in
`publish.rs::publish_with_keys` and `profiles.rs::publish_metadata_async`.
Now one `pub(crate) publish::send_to_all_relays(client, urls, event, noun)`
serves both; callers keep their distinct add-relay policies (note path
aborts on add errors, metadata ignores them) so behavior, error strings,
and public APIs are unchanged. Removed duplicate constant
`METADATA_SEND_TIMEOUT`, dead helper `failure_for`. Net −49 lines.
2. Deliberately NOT done (pending approval): R2 shared client-bootstrap
helper, R3 modal save-lifecycle hook (frontend), R4 shortHex/shortenNpub.
## Commits added most recently
- `1c428a9` DRY: single parallel relay fan-out for notes and metadata
## Verification commands run (all green)
Rust: cargo fmt --check clean; clippy only pre-existing profiles.rs warnings;
cargo test 113 passed; release binary rebuilt.
Frontend (untouched, suite rerun): npm test 92 passed; typecheck, lint,
format:check, electron:build, vite build all clean.
## How to use / reproduce
No user-facing change; note and metadata publishing behave exactly as before.
Any future change to relay-send policy now happens in one place:
`send_to_all_relays` in `src/publish.rs`.
## Notes & next steps
- R2–R4 from the DRY audit remain unimplemented by request.
- Relay health today: nos.lol 502, nostr.wine 403, nostr.l484.com needs
NIP-42 auth, nostr.band unreachable; primal/mom/soloco healthy.
---
# Older checkpoint — NIP-46 signer handshake fix (2026-08-24)
A stopping point you can return to if this session is closed. Everything below was
verified green at the moment this file was written.