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