fix(qobuz): back off between bundle-extraction retries

The 3 bundle-extraction attempts fired back-to-back, so a brief network hiccup
(DNS blip, dropped connection, captive-portal redirect) failed all of them in a
few ms and the retries were effectively useless — surfacing as "Failed to
extract bundle tokens: Network error" at sign-in. Add a short growing delay
(600ms, 1200ms) between attempts so a transient failure has time to clear.

cc
This commit is contained in:
vicrodh committed 2026-07-17 19:36:49 -06:00
1 parent 3b0d8e7641
commit 1f608cddc9
1 file changed
+8
+8
View File
@@ -199,6 +199,14 @@ pub async fn extract_and_cache_bundle_tokens(client: &Client) -> Result<BundleTo
e
);
last_err = Some(e);
// Back off before the next attempt. The attempts used to fire
// back-to-back, so a brief network hiccup (DNS blip, dropped
// connection, captive-portal redirect) failed all of them in a
// few ms — the retries were effectively useless. A short growing
// delay gives a transient failure time to clear.
if attempt < attempts {
tokio::time::sleep(Duration::from_millis(600 * attempt as u64)).await;
}
}
}
}