Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ test('local Peer Mesh join keeps invitations off argv and accepts bounded large
peerId: `peer-${meshIndex}-${memberIndex}-${'x'.repeat(48)}`,
endpointKind: 'client' as const,
displayName: `Member ${meshIndex}-${memberIndex} ${'x'.repeat(60)}`,
state: 'route_available' as const,
state: 'reachable' as const,
expiresAt: 4_000_000_000_000,
})),
pendingInvitationCount: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ test('sends a Mesh invitation only after the authenticated remote operator reque
revision: 2,
closed: false,
members: [
{ peerId: 'peer-a', state: 'route_available', expiresAt: Date.now() + 60_000 },
{ peerId: 'peer-a', state: 'reachable', expiresAt: Date.now() + 60_000 },
{ peerId: 'peer-b', state: 'local' },
],
pendingInvitationCount: 0,
Expand Down
6 changes: 5 additions & 1 deletion apps/desktop/src/main/runtime-host-peer-mesh-management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,11 @@ async function reconcileManagedTarget(

function authorityRouteNeedsRecovery(mesh: PeerMeshQueryResult['meshes'][number]): boolean {
const authority = mesh.members.find(({ peerId }) => peerId === mesh.authorityPeerId);
return authority === undefined || authority.state === 'unknown' || authority.state === 'stale';
return (
authority === undefined ||
authority.state === 'needs_repair' ||
authority.state === 'reconnecting'
);
}

function requireQueryResult(result: PeerMeshResult): PeerMeshQueryResult {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,8 @@ export function RuntimeHostPeerMeshDialog(props: {
meshId,
code: JSON.stringify(result.invitation),
expiresAt: result.invitation.expiresAt,
hasCoordinationRelay: result.invitation.coordinationRelays.length > 0,
hasCoordinationRelay:
result.invitation.reachability.lease.coordinationRoutes.length > 0,
});
setSnapshot(result.snapshot);
},
Expand Down Expand Up @@ -1918,10 +1919,10 @@ function peerMeshCopy(locale: string) {
circuits: '连接',
routeState: {
local: '本机',
route_available: '路径可用',
coordination_only: '仅协调路径',
stale: '路径已过期',
unknown: '路径未知',
connecting: '正在连接',
reachable: '可达',
reconnecting: '正在恢复连接',
needs_repair: '需要新邀请码修复',
},
endpointKind: {
client: 'Client',
Expand Down Expand Up @@ -2078,10 +2079,10 @@ function peerMeshCopy(locale: string) {
circuits: 'Circuits',
routeState: {
local: 'Local',
route_available: 'Route known',
coordination_only: 'Coordination only',
stale: 'Stale route',
unknown: 'Route unknown',
connecting: 'Connecting',
reachable: 'Reachable',
reconnecting: 'Reconnecting',
needs_repair: 'Needs a new invitation',
},
endpointKind: {
client: 'Client',
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/renderer/styles/settings/runtime-host.css
Original file line number Diff line number Diff line change
Expand Up @@ -723,11 +723,11 @@
}

.settingsPeerMeshMemberState-local,
.settingsPeerMeshMemberState-route_available {
.settingsPeerMeshMemberState-reachable {
background: var(--success);
}

.settingsPeerMeshMemberState-coordination_only {
.settingsPeerMeshMemberState-reconnecting {
background: var(--warning);
}

Expand Down
Loading
Loading