mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 07:25:19 +00:00
Problem: - Ghost peers from yesterday appeared on app restart - Old messages resurfaced after restarting - Peers running 24+ hours synced stale data to restarting peers Root causes: 1. GossipSyncManager stored packets indefinitely (no time limit) 2. handleAnnounce/handleMessage had no timestamp validation 3. Relayed announces from other peers could be arbitrarily old Solution (defense in depth): - Added 15-minute age window to GossipSyncManager config - Gossip storage rejects expired packets at ingestion - Gossip sync responses filter out expired packets - GCS payload building excludes expired packets - Periodic cleanup removes expired announcements/messages - handleAnnounce rejects stale announces before processing - handleMessage rejects stale broadcast messages before processing This prevents ghost peers from appearing on restart and ensures only recent mesh state is synchronized between peers. Co-authored-by: jack <jackjackbits@users.noreply.github.com>