Repository navigation
fix(network): reduce clock skew threshold to 1 minute - #6912
SeniorZhai wants to merge 1 commit into
Conversation
|
AI review done for Quality: Needs a fix before merge because a false clock warning can interrupt an active session. The clock comparisons were verified in isolation, with the Android flow reviewed by inspection.
|
There was a problem hiding this comment.
AI review · Codex · 5d0ca08
git diff --check passed, and isolated Kotlin checks reproduced the regression with delayed loopback responses. Android assembly, lint, and unit tests were blocked during offline Gradle configuration because the Foojay plugin was unavailable.
| const val INTERVAL_60_DAYS: Long = INTERVAL_24_HOURS * 60 | ||
| const val DELAY_SECOND = 60 | ||
| const val ALLOW_INTERVAL: Long = (5 * 60 * 1000).toLong() | ||
| const val ALLOW_INTERVAL: Long = (1 * 60 * 1000).toLong() |
There was a problem hiding this comment.
The interceptor compares X-Server-Time after reading the full response body, so the new cutoff counts download time as clock skew. In a loopback check, a phone clock 59.5 seconds ahead was flagged after a one-second response delay. A correctly set clock was also flagged when a response took over a minute without hitting the per-read timeout. Confirm the skew with a fresh ping that accounts for latency before taking the app offline, and use the same measurement for recovery.
No description provided.