From e946fbe4433257f9b7b6b85512011952f58d9365 Mon Sep 17 00:00:00 2001 From: chahinebrini Date: Thu, 21 May 2026 23:44:15 +0200 Subject: [PATCH] =?UTF-8?q?fix(ios-vpn):=20activateUrlFilter=20=E2=80=94?= =?UTF-8?q?=20Tunnel-Status=20bis=20.connected=20pollen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Die Warte-Schleife lief nur solange status==.connecting. Direkt nach startVPNTunnel() steht der Status aber oft noch kurz auf .disconnected β†’ Schleife uebersprungen β†’ sofort false-negative 'tunnel_not_connected', obwohl der Tunnel Sekundenbruchteile spaeter sauber connected. Jetzt: pollen bis .connected oder .invalid oder ~6s Timeout. Co-Authored-By: Claude Opus 4.7 --- .../rebreak-protection/ios/RebreakProtectionModule.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/rebreak-native/modules/rebreak-protection/ios/RebreakProtectionModule.swift b/apps/rebreak-native/modules/rebreak-protection/ios/RebreakProtectionModule.swift index 1cc2dab..c33c465 100644 --- a/apps/rebreak-native/modules/rebreak-protection/ios/RebreakProtectionModule.swift +++ b/apps/rebreak-native/modules/rebreak-protection/ios/RebreakProtectionModule.swift @@ -130,11 +130,14 @@ public class RebreakProtectionModule: Module { SharedLogStore.append("πŸš€ [activateUrlFilter] startVPNTunnel...") try session.startVPNTunnel() - // Auf stabilen Status warten (max ~3,2s) β€” direkt nach dem Start - // steht er auf .connecting. + // Auf .connected warten. Direkt nach startVPNTunnel() steht der Status + // oft noch kurz auf .disconnected, BEVOR er auf .connecting β†’ .connected + // wechselt. Daher pollen bis .connected ODER Timeout (β‰ˆ6s) β€” NICHT nur + // solange .connecting (sonst false-negative tunnel_not_connected in der + // frΓΌhen .disconnected-Phase). .invalid = Konfig-Fehler β†’ sofort raus. var status = manager.connection.status var waited = 0 - while (status == .connecting || status == .reasserting) && waited < 8 { + while status != .connected && status != .invalid && waited < 15 { try? await Task.sleep(nanoseconds: 400_000_000) status = manager.connection.status waited += 1