Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/client/app_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,7 @@ impl Client {
}

/// Sync multiple collections in a single IQ request, re-fetching those with `has_more_patches`.
/// Matches WA Web's `serverSync()` outer loop (`3JJWKHeu5-P.js:54278-54305`).
/// Max 5 iterations (WA Web's `C=5` constant).
/// Mirrors WA Web's `serverSync()` outer loop (`WAWebSyncdServerSync`).
///
/// `key_wait_deadline` bounds how long a missing app-state decode key may be
/// awaited. The initial critical bootstrap passes the shared 180s critical-sync
Expand Down Expand Up @@ -550,6 +549,14 @@ impl Client {
key_wait_deadline: Option<wacore::time::Instant>,
) -> Result<()> {
use wacore::appstate::patch_decode::CollectionSyncError;
// Not WA Web's number, despite the shape being the same: its outer loop
// bounds at `C = 500`, and the `y = 5` sitting beside it never bites
// because the `||` between them keeps 500 the only real limit.
// Exhausting it there marks the collections retryable and hands them to
// a backoff state machine rather than giving up. We have neither that
// state nor the spacing, so raising this on its own would only buy up to
// 500 back-to-back IQ rounds; the cap and the backoff belong in one
// change.
const MAX_ITERATIONS: usize = 5;
let mut iteration = 0;

Expand Down
Loading