diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-19 13:10:58 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-19 13:10:58 +0000 |
| commit | 7e72cf46961852c650935633c0164f38c736aca5 (patch) | |
| tree | 1f653f65b8a8e41ff26660f6598135941ac8ce92 /src/sync/algorithms.rs | |
| parent | 00026a185b4b48d7179d02b50ea9e1802cd7e7e4 (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