mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 16:02:26 +00:00
Built a deterministic NIP-07 channel-simulation harness (scripts/perf/nip07-channel-sim.mjs) that reproduces the real cold-login failure locally with a fake extension whose message channel drops under concurrent load (MODE=overload), recovers (MODE=slow), or stays dead. It seeds a real encrypted block list and reports whether it decrypts. The harness pinned the actual root cause that the relay/breaker/timeout work hadn't fixed: when the channel briefly drops during the login burst, the per-scheme decrypt probe (Promise.any) rejects with "message channel closed" — and every list service SWALLOWED that and treated it as "the user has no blocks / no subs / no hashtags", or routed it to a give-up branch. Either way: no retry, so the list stayed empty until a full page refresh, even though the channel recovered seconds later. Fix: classify transient failures (channel-death messages, breaker fast-fail code, our own decrypt-timeout) and route them to the existing keep-stale + scheduleDecryptRetry path instead of swallowing/abandoning: - userBlocks: re-throw a transient sub-error out of the Promise.any probe (was silently returning [] = "no blocks"); route it (and channel/breaker errors) through the retry branch. - hashtagPreferencesService + subscriptions: broaden the retry condition from the timeout code only to any transient error, recursing into the nested Promise.any AggregateError causes. Harness verdict (MODE=overload, 16 channel drops): block list BLOCK LIST DECRYPTED NO -> YES after the fix; signer-ready ~1.9s. Adds getAppState().lists observability to the test harness. Full unit suite green. KNOWN_BUGS #0. Co-Authored-By: Claude Opus 4.8 <[email protected]>