Skip to content

Commit 1d8cd45

Browse files
committed
Measure WEB recovery deadlines across device sleep
1 parent b971d5a commit 1d8cd45

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- Failed TCP endpoints share monotonic cooldown and a single recovery probe across contexts; duplicate connects reuse the existing connection, and closed interfaces release read buffers.
1111
- WEB resume requests coalesce per carrier. Stale callbacks cannot restart disabled/replaced profiles; duplicate failures count once and short-lived sessions retain backoff history.
1212
- Foreground events join an existing WEB bootstrap and respect its cooldown instead of superseding it; queued obsolete starts exit before opening a new session.
13+
- WEB elapsed-time checks use a continuous monotonic clock, including device sleep, for background dwell, session health and cooldown.
1314
- Removed the global WebSocket fallback cancellation and the mid-transaction state replay timeout. State replay finishes atomically instead of committing a prefix and resetting synchronization.
1415
- Stale PTS snapshots retry difference synchronization without a full account reset. WebSocket dial requests are one-shot across fallback gaps and use a monotonic fallback clock.
1516
- Fetch completion is logged once at queue removal, with location and episode, rather than again in the result observer. TCP attempts have IDs for correlation and log the effective connection deadline.

‎submodules/WebProxyTransport/Sources/WebProxyManager.swift‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
import Foundation
22
import Network
3+
import Darwin
4+
5+
// Monotonic elapsed time including device sleep. systemUptime excludes sleep and
6+
// could make an overnight suspension look like a brief foreground flicker.
7+
// https://developer.apple.com/documentation/kernel/1646199-mach_continuous_time
8+
private func webProxyContinuousTime() -> Double {
9+
return Double(clock_gettime_nsec_np(CLOCK_MONOTONIC_RAW)) / 1_000_000_000.0
10+
}
311

412
public struct WebProxyConfiguration: Equatable {
513
public let hostname: String

0 commit comments

Comments
 (0)