docs(checkpoint): silent poll fix at 3d1c306, session-restore gap named (2026-09-23)

This commit is contained in:
Avi 2026-09-23 15:09:51 -05:00
commit 327bf0ffe0

View file

@ -1,3 +1,59 @@
# Checkpoint — silent state poll + session-restore gap named (2026-09-23 PM)
## Where things are
- Project: `/home/avi/Projects/Keynctr`
- Branch: `master` @ **`3d1c306`** ("fix(ui): silent background state poll").
Previous: `5714349` (checkpoint), `6ebc364` (remote rename).
- Working tree: clean for tracked files. Untracked intentionally NOT
committed: `COSMIC_THEME.md`, `KeynectrAppIconPossibility02.jpeg`,
`deferred/` (stays deferred).
- Release binary: current at `6ebc364` (Rust unchanged since). Renderer
rebuilt via `npm run build`. Restart Electron before retesting.
## What was completed this session
1. **Diagnosed the Home flicker (my `a8d112b` polling regression)**: every
5s poll delivered a fresh state object identity, so Home's publications
loader (`useProfilePublications`, keyed on `settings.relays` identity)
refired forever — "Loading publications…" cycling. Fixed in `3d1c306`:
`refresh()` keeps the previous state object when content-identical (JSON
compare), so idle polls are re-render silent. Poll timer uses global
`setInterval` (testable under fake timers).
2. **Regression test + harness fidelity**: new HomeScreen test proves
`feed_get` fires once across 12s of polling (verified RED without the
guard: 3 fetches). `fakeBackend` `get_state` now deep-copies like the
real IPC boundary — the shared-reference version masked the bug.
3. **Diagnosed the publish failure**: backend restarted 14:57 for the rename
build, which killed the in-memory NIP-46 session (client keys + subs are
memory-only by design). Vault keeps the connection row, but there is NO
session restore on startup — publishing fails closed with "external
signer selected but not connected" while Amber still shows connected.
Re-scanning the QR re-establishes it (proven path). Automatic restore
(fresh `connect` against the stored row) is the follow-up, not this
change.
- Verification (all green at `3d1c306`): frontend `npm test` **120 passed
(18 files)**, `typecheck`, `lint`, `format:check`, `electron:build`,
`build` clean. Rust untouched (last green at `6ebc364`: 212 unit + 4 e2e,
clippy/fmt clean).
## Commits added (newest first)
- `3d1c306` fix(ui): silent background state poll - no refetch churn when
vault unchanged
## How to resume / reproduce
- Restart Electron → Home no longer flickers; Rename works as in `6ebc364`.
- To publish: Signer Mode → Show QR → re-scan in Amber (session does not
survive restarts yet) → Compose → Publish (approval lands in Amber).
## Outstanding / next steps
1. **NIP-46 session restore on startup** (fresh handshake against the stored
connection row) — publishing after any restart currently needs a re-scan.
2. **Live sign/publish through paired Amber** (never exercised live).
3. Prune the 11 stale profileless `nip46_connections` rows (cosmetic).
4. Remote picture/nip05 edits, kind-0 via `Signing` (P2), KDF upgrade
(Step 5), rename pass (Step 7) — unchanged.
---
# Checkpoint — remote-profile rename; live pairing aftermath (2026-09-23 PM)
## Where things are