mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-12 09:13:23 +00:00
A cold boot trace showed `[giftwrap] load done: idle` firing with 0 events at +3s while the DM relays had not even connected yet (nos.lol first connected at +14s). The idle watchdog could not tell "quiet because the relays answered" from "quiet because nothing has connected", so a slow boot looked finished with an empty result — and with the Messages screen open that false "done, 0 events" would trip the auto-fill into widening the window over and over. WindowLoadTracker now only arms the idle path after the first event or EOSE (sawActivity). Before that first sign of life, the load can only end via a generous no-response bound (30s) or the absolute cap, so a still-connecting boot stays "loading" instead of falsely completing empty. The clean paths are unchanged: relays that EOSE complete via "all relays", and a stream that starts then quiets still completes via "idle". Also makes the gift-wrap load-summary collector a singleton: the tracker is shared across accounts, so launching it per newSub double-logged every summary when a second account was logged in. Per-load counters are now reset synchronously at load start (beginWindowLoad) rather than on the collector's rising edge, so no in-flight event is counted against the wrong load. https://claude.ai/code/session_01B1fmmmX8JjQWH3amMLdvcW