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:
Eulices Lopez 2026-03-19 11:24:12 -04:00
parent 300e494653
commit c4d727a2b8

View File

@ -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)
}
}