Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
7 changes: 1 addition & 6 deletions src/sdk/devbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,14 @@ export class DevboxNetOps {
}

/**
* @deprecated Only works with legacy tunnels created via {@link createTunnel}.
* V2 tunnels (from {@link enableTunnel}) remain active until devbox shutdown and cannot be removed.
*
* Remove a legacy tunnel from the devbox.
* Remove an existing V2 tunnel from the devbox.
*
* @example
* ```typescript
* // Deprecated - only for legacy tunnels
* await devbox.net.removeTunnel();
* ```
*
* @param {Core.RequestOptions} [options] - Request options
* @returns {Promise<DevboxRemoveTunnelResponse>} Tunnel removal result
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't this still return an empty promise

*/
async removeTunnel(options?: Core.RequestOptions) {
return this.client.devboxes.removeTunnel(this.devboxId, options);
Expand Down
5 changes: 5 additions & 0 deletions tests/smoketests/object-oriented/devbox.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@ describe('smoketest: object-oriented devbox', () => {
const info = await devbox.getInfo();
expect(info.tunnel).toBeDefined();
expect(info.tunnel?.tunnel_key).toBe(tunnel.tunnel_key);

await devbox.net.removeTunnel();

const tunnelAfterRemoval = await devbox.getTunnel();
expect(tunnelAfterRemoval).toBeNull();
} finally {
await devbox.shutdown();
}
Expand Down
Loading