Skip to content

Commit eb1fbbf

Browse files
committed
Fix CI compile errors for v12.9.2-3938-pre release
Rename Network.applyWebSocketTransport instance method to updateWebSocketTransportSettings to avoid recursive resolution with the global applyWebSocketTransport helper. Wrap MTProxyConnectivity ping tokens in ActionDisposable for ManagedProxyFailover. Expand CHANGELOG 3938-pre with full censorship network stack notes. Co-authored-by: D3C0Y <decoder-dev@users.noreply.github.com>
1 parent 19a1655 commit eb1fbbf

4 files changed

Lines changed: 14 additions & 12 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66

77
## [Unreleased]
88

9-
### Fixed
10-
- **Proxy rotation:** reschedule wait-and-probe while still connecting when no faster proxy is found or cooldown blocks a switch; dispose in-flight probes on settings change.
11-
129
## [v12.9.2-3938-pre] — 2026-09-02
1310

14-
Pre-release: WebSocket transport hardening + proxy rotation probe watchdog.
11+
Pre-release: censorship network stack (proxy rotation, FakeTLS DC fallback, WebSocket hardening).
12+
13+
### Added
14+
- **Proxy rotation:** Android-style ping-based auto-switch — configurable wait (5/10/15/30/60 s), RTT probe via `MTProxyConnectivity`, switch to fastest live server; timeout picker in Settings → Proxy.
1515

1616
### Fixed
17-
- **WebSocket:** handle NWConnection `.cancelled` so MtProtoKit is notified instead of hanging on "Connecting…".
18-
- **WebSocket:** debounce viability loss (2s, post-`.ready` only) — same policy as direct NWConnection TCP.
19-
- **WebSocket:** fallback coordinator persists on `Network` across settings re-applies (proxy toggle no longer resets failure count / probe schedule).
20-
- **Proxy rotation:** 30s watchdog on stuck MTProxy ping probes so `isChecking` cannot block rotation forever.
17+
- **FakeTLS:** HMAC mismatch on `ee` MTProxy triggers DNS TXT backup → `configSimple` DC fallback (Mozilla DNS after Google); mirrors Android tgnet.
18+
- **WebSocket:** fallback to direct transport uses `NetworkFrameworkTcpConnectionInterface`, not GCDAsyncSocket.
19+
- **WebSocket:** handle NWConnection `.cancelled`; debounce viability loss (2s post-`.ready`); persistent fallback coordinator on `Network`.
20+
- **Proxy rotation:** 30s probe watchdog; reschedule wait-and-probe while still connecting when no faster proxy is found.
2121

2222
## [v12.9.2-3937-pre] — 2026-09-02
2323

‎submodules/TelegramCore/Sources/Account/Account.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1574,7 +1574,7 @@ public class Account {
15741574
// state `applyWebSocketTransport` gates on) changes, otherwise flipping "WebSocket
15751575
// Transport" in Settings — or enabling/disabling a proxy server while WS transport is
15761576
// on — has no effect until the app is relaunched.
1577-
network.applyWebSocketTransport(
1577+
network.updateWebSocketTransportSettings(
15781578
webSocketTransportEnabled: webSocketTransportEnabled,
15791579
webSocketFallbackToDirect: webSocketFallbackToDirect,
15801580
hasActiveProxyServer: hasActiveProxyServer

‎submodules/TelegramCore/Sources/Network/Network.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ func applyWebSocketTransport(context: MTContext, webSocketTransportEnabled: Bool
536536
}
537537

538538
extension Network {
539-
func applyWebSocketTransport(webSocketTransportEnabled: Bool, webSocketFallbackToDirect: Bool, hasActiveProxyServer: Bool) {
539+
func updateWebSocketTransportSettings(webSocketTransportEnabled: Bool, webSocketFallbackToDirect: Bool, hasActiveProxyServer: Bool) {
540540
applyWebSocketTransport(
541541
context: self.context,
542542
webSocketTransportEnabled: webSocketTransportEnabled,

‎submodules/TelegramCore/Sources/State/ManagedProxyFailover.swift‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ private func probeProxyRotationServersOnce(network: Network, servers: [ProxyServ
4343
}
4444
continue
4545
}
46-
let disposable = MTProxyConnectivity.pingProxy(with: network.context, datacenterId: network.datacenterId, settings: settings).start(next: { status in
46+
let token = MTProxyConnectivity.pingProxy(with: network.context, datacenterId: network.datacenterId, settings: settings).start(next: { status in
4747
lock.lock()
4848
if let status = status as? MTProxyConnectivityStatus {
4949
if status.reachable {
@@ -61,7 +61,9 @@ private func probeProxyRotationServersOnce(network: Network, servers: [ProxyServ
6161
subscriber.putCompletion()
6262
}
6363
})
64-
disposables.append(disposable)
64+
disposables.append(ActionDisposable {
65+
token?.dispose()
66+
})
6567
}
6668
return ActionDisposable {
6769
for disposable in disposables {

0 commit comments

Comments
 (0)