Skip to content

fix(network): reduce clock skew threshold to 1 minute - #6912

Open
SeniorZhai wants to merge 1 commit into
masterfrom
fix/clock-skew-interval
Open

SeniorZhai wants to merge 1 commit into
masterfrom
fix/clock-skew-interval

Conversation

@SeniorZhai

Copy link
Copy Markdown
Member

No description provided.

@gaotic

gaotic Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

AI review done for 5d0ca08 in 4m 45s · 1 comment

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.

Role Model Status
Reviewer Codex codex/gpt-6.2-sol · effort high ok

@gaotic gaotic Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant