fix(#333): load channels before channel history, or history reads empty
Channel history is keyed by the channel's PSK (#194), and the resolver set on the store reads that PSK out of _channels. After SELF_INFO, loadCachedChannels() and loadAllChannelMessages() were both fired without awaiting, so the messages could load while _channels was still empty. The resolver then returned null, _storageKey() silently fell back to the legacy slot-index key, and channels read as empty even though their history was intact under the PSK key. Silent because the fallback is a legitimate code path: there is no error, no parse failure and no log line, just an empty list. It is indistinguishable from data loss to the user. Observed on a live radio: Public held 566 messages under channel_messages_<dev>psk_8b3387e9..., and the app displayed nothing. loadAllChannelMessages() now runs only after loadCachedChannels() completes. The startup call in main.dart already awaits in the right order; it runs before any radio is connected, which is the source of the "Public key hex is not set" warnings at launch, and is harmless once this post-connect load is correct. Was previously committed against #291 on the nav-redesign branch; split out here under its own issue.integration/290-306-335
parent
e17f539d7e
commit
2c80be3244
Loading…
Reference in new issue