fix(ios): guard async gateway config refreshes
Follow up on review feedback by re-checking the active gateway state after awaiting the permission snapshot refresh. If auto-reconnect was disabled or the active gateway changed during the async gap, the stale task now exits instead of re-applying an old config.
This commit is contained in:
parent
300e494653
commit
c4d727a2b8
@ -241,6 +241,13 @@ final class GatewayConnectionController {
|
||||
bootstrapToken: cfg.bootstrapToken,
|
||||
password: cfg.password,
|
||||
nodeOptions: await self.makeConnectOptions(stableID: cfg.stableID))
|
||||
|
||||
guard appModel.gatewayAutoReconnectEnabled,
|
||||
let latestConfig = appModel.activeGatewayConnectConfig,
|
||||
latestConfig.effectiveStableID == cfg.effectiveStableID,
|
||||
latestConfig.url == cfg.url
|
||||
else { return }
|
||||
|
||||
appModel.applyGatewayConnectConfig(refreshedConfig)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user