fix(relay): a revoked host can relink while its old connector is still up #45637
Mergedshivamhwp(GitHub profile, opens in a new tab)merged 1 commit into
main fromrefs/pull/45637/headmerged by shivamhwp(GitHub profile, opens in a new tab) View on GitHubshivamhwp(GitHub profile, opens in a new tab) linked this to fix #43179
tanstack-source added labelsbug
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
- @@ -310,8 +310,12 @@310310 }311311 // An unlink whose teardown failed leaves its tunnel behind, and provisioning would reuse it by312312 // name. Finish the teardown before any new link, publish-only too: once that link is active313- // it could turn tunnels on and inherit the old one.313+ // it could turn tunnels on and inherit the old one. Forced, because a host whose link was314+ // revoked keeps its connector up, and Cloudflare refuses to delete a connected tunnel.314315 if (existing === null) {315316 const key = { userId: input.userId, environmentId: verified.environmentId };316317 const leftover = yield* managedEndpointProvider.prepareDeprovision(key);317- if (!(yield* managedEndpointProvider.deprovision({ ...key, target: leftover }))) {318+ const removed = yield* managedEndpointProvider.deprovision({319+ ...key,320+ target: leftover,321+ forceDisconnect: true,
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
- @@ -310,8 +310,12 @@310310 }311311 // An unlink whose teardown failed leaves its tunnel behind, and provisioning would reuse it by312312 // name. Finish the teardown before any new link, publish-only too: once that link is active313- // it could turn tunnels on and inherit the old one.313+ // it could turn tunnels on and inherit the old one. Forced, because a host whose link was314+ // revoked keeps its connector up, and Cloudflare refuses to delete a connected tunnel.314315 if (existing === null) {315316 const key = { userId: input.userId, environmentId: verified.environmentId };316317 const leftover = yield* managedEndpointProvider.prepareDeprovision(key);317- if (!(yield* managedEndpointProvider.deprovision({ ...key, target: leftover }))) {318+ const removed = yield* managedEndpointProvider.deprovision({319+ ...key,320+ target: leftover,321+ forceDisconnect: true,
Pushed9641006
shivamhwp(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed