Keep verified Gateway active through transient discovery failures
Build and Deploy Gateway / build-and-push (push) Successful in 16s
Build and Deploy Gateway / deploy (push) Successful in 7s

This commit is contained in:
2026-07-31 10:57:00 +03:00
parent c6d3fd39fb
commit fdc6f687f3
5 changed files with 39 additions and 18 deletions
+9 -6
View File
@@ -190,10 +190,16 @@ export function applyGatewayPreference(state, enabled) {
export function nextGatewayAutoState(current, {
network,
verifiedGateway = null,
failureLimit = 3,
error = 'Gateway presence check failed',
}) {
if (!network) return createGatewayAutoState();
if (!network) {
if (!current.gatewayId) return createGatewayAutoState();
return {
...current,
failures: current.failures + 1,
lastError: String(error || 'Gateway presence check failed'),
};
}
const routeChanged = !sameGatewayRoute(current.gateway, network);
const base = routeChanged
@@ -215,11 +221,8 @@ export function nextGatewayAutoState(current, {
const failures = base.failures + 1;
return {
...base,
mode: base.mode === 'gateway-direct' && failures < failureLimit
? 'gateway-direct'
: 'local-vpn',
mode: base.gatewayId ? 'gateway-direct' : 'local-vpn',
failures,
gatewayId: failures < failureLimit ? base.gatewayId : '',
lastError: String(error || 'Gateway presence check failed'),
};
}
+11 -4
View File
@@ -302,10 +302,17 @@ function refreshGatewayAutoMode({ reconfigure = true } = {}) {
: null;
if (!network) {
const nextState = nextGatewayAutoState(gatewayAutoState, { network: null });
if (state.subscriptionUrl) {
nextState.lastError = 'macOS default gateway недоступен или устарел';
}
const discoveryError = 'macOS default gateway недоступен или устарел';
const discoveredState = nextGatewayAutoState(gatewayAutoState, {
network: null,
error: discoveryError,
});
const nextState = applyGatewayPreference(
state.subscriptionUrl
? { ...discoveredState, lastError: discoveryError }
: discoveredState,
state.gatewayAutoEnabled !== false,
);
await applyGatewayAutoState(
nextState,
{ reconfigure },
+2 -2
View File
@@ -1,7 +1,7 @@
export const HARBOR_VERSIONS = Object.freeze({
macClient: '0.8.11',
macClient: '0.8.12',
gatewayClient: '0.8.10',
gatewayBackend: '0.8.0',
gatewayBackend: '0.8.1',
});
export function parseVersion(value) {