upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/sync/algorithms.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2025-12-19 13:10:58 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2025-12-19 13:10:58 +0000
commit7e72cf46961852c650935633c0164f38c736aca5 (patch)
tree1f653f65b8a8e41ff26660f6598135941ac8ce92 /src/sync/algorithms.rs
parent00026a185b4b48d7179d02b50ea9e1802cd7e7e4 (diff)
Fix: Capture old_last_connected before updating state
Bug: handle_connect_or_reconnect() was incorrectly calling quick_reconnect() on first connections instead of fresh_start(). Root cause: The code updated last_connected = Some(now) at line 808, then immediately read it back at line 932 to make the reconnection decision. This meant first connections saw elapsed = now - now = 0 seconds, which triggered quick_reconnect() instead of fresh_start(). Fix: Capture old_last_connected BEFORE updating the state, then use that value for the reconnection decision. Now first connections correctly see None and call fresh_start(). Impact: - First connections now properly use fresh_start() with full historic sync - Short disconnections (< 15 min) use quick_reconnect() with since filter - Long disconnections (> 15 min) use fresh_start() with full resync All 41 sync tests passing.
Diffstat (limited to 'src/sync/algorithms.rs')
0 files changed, 0 insertions, 0 deletions