Skip to content

Commit 9abcfd8

Browse files
committed
chore: retire legacy v3 dev websocket execution + legacy self-hosting docs
The v3 (engine V1) is end-of-lifed and enforced off in prod. Remove the dead legacy execution behind the deprecated dev websocket while KEEPING the user-facing deprecation message so old `trigger dev` CLIs are still told to upgrade: - app/v3/handleWebsockets.server.ts: the /ws websocket is only used by the legacy v3 dev CLI (v4 uses a different transport). Authenticate, then close with V3_DEV_DEPRECATION_MESSAGE. Drops the AuthenticatedSocketConnection / DevQueueConsumer legacy path that can no longer run. - Delete app/v3/authenticatedSocketConnection.server.ts (its only consumer). Docs: delete the intentionally-legacy 'Docker (legacy)' self-hosting page and redirect /open-source-self-hosting (+ the /v3 alias) to /self-hosting/overview; repoint the two inbound links. Scoped deliberately: MarQS and the rest of the v3-engine removal are left for a follow-up - MarQS is entangled with live v2 queue/metrics/cleanup code and needs a per-file reviewed pass, not a bulk delete.
1 parent a6bd370 commit 9abcfd8

6 files changed

Lines changed: 18 additions & 774 deletions

File tree

apps/webapp/app/v3/authenticatedSocketConnection.server.ts

Lines changed: 0 additions & 181 deletions
This file was deleted.

apps/webapp/app/v3/handleWebsockets.server.ts

Lines changed: 10 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,15 @@ import { WebSocketServer, type WebSocket } from "ws";
33
import { authenticateApiKey } from "~/services/apiAuth.server";
44
import { logger } from "~/services/logger.server";
55
import { singleton } from "../utils/singleton";
6-
import { AuthenticatedSocketConnection } from "./authenticatedSocketConnection.server";
7-
import { Gauge } from "prom-client";
8-
import { metricsRegister } from "~/metrics.server";
9-
import { isV3Disabled, V3_DEV_DEPRECATION_MESSAGE } from "./engineDeprecation.server";
6+
import { V3_DEV_DEPRECATION_MESSAGE } from "./engineDeprecation.server";
107

118
export const wss = singleton("wss", initalizeWebSocketServer);
129

13-
let authenticatedConnections: Map<string, AuthenticatedSocketConnection>;
14-
1510
function initalizeWebSocketServer() {
1611
const server = new WebSocketServer({ noServer: true });
1712

1813
server.on("connection", handleWebSocketConnection);
1914

20-
authenticatedConnections = new Map();
21-
22-
new Gauge({
23-
name: "dev_authenticated_connections",
24-
help: "Number of authenticated dev connections",
25-
collect() {
26-
this.set(authenticatedConnections.size);
27-
},
28-
registers: [metricsRegister],
29-
});
30-
3115
return server;
3216
}
3317

@@ -59,35 +43,14 @@ async function handleWebSocketConnection(ws: WebSocket, req: IncomingMessage) {
5943

6044
const authenticatedEnv = authenticationResult.environment;
6145

62-
// This legacy websocket is only used by the v3 `trigger dev` CLI (v4 uses a
63-
// different dev transport). When the v3 shutdown is on, close it with a
64-
// graceful reason instead of letting the CLI sit connected with no work.
65-
if (isV3Disabled()) {
66-
logger.warn("Rejected deprecated v3 dev CLI websocket connection", {
67-
environmentId: authenticatedEnv.id,
68-
projectId: authenticatedEnv.projectId,
69-
organizationId: authenticatedEnv.organizationId,
70-
});
71-
ws.close(1008, V3_DEV_DEPRECATION_MESSAGE);
72-
return;
73-
}
74-
75-
const authenticatedConnection = new AuthenticatedSocketConnection(
76-
ws,
77-
authenticatedEnv,
78-
req.headers["x-forwarded-for"] ?? req.socket.remoteAddress ?? "unknown"
79-
);
80-
81-
authenticatedConnections.set(authenticatedConnection.id, authenticatedConnection);
82-
83-
authenticatedConnection.onClose.attachOnce((closeEvent) => {
84-
logger.debug("Websocket closed", {
85-
closeEvent,
86-
authenticatedConnectionId: authenticatedConnection.id,
87-
});
88-
89-
authenticatedConnections.delete(authenticatedConnection.id);
46+
// This websocket is only used by the legacy v3 `trigger dev` CLI (v4 uses a
47+
// different dev transport). The v3 engine is end-of-lifed, so there is no
48+
// longer any work to run here — close with the graceful upgrade message so
49+
// an old CLI is told what to do instead of sitting connected.
50+
logger.warn("Rejected deprecated v3 dev CLI websocket connection", {
51+
environmentId: authenticatedEnv.id,
52+
projectId: authenticatedEnv.projectId,
53+
organizationId: authenticatedEnv.organizationId,
9054
});
91-
92-
await authenticatedConnection.initialize();
55+
ws.close(1008, V3_DEV_DEPRECATION_MESSAGE);
9356
}

docs/docs.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,7 @@
286286
{
287287
"group": "Environment variables",
288288
"pages": ["self-hosting/env/webapp", "self-hosting/env/supervisor"]
289-
},
290-
"open-source-self-hosting"
289+
}
291290
]
292291
},
293292
{
@@ -735,9 +734,13 @@
735734
"source": "/v3/upgrading-from-v2",
736735
"destination": "/guides/use-cases/upgrading-from-v2"
737736
},
737+
{
738+
"source": "/open-source-self-hosting",
739+
"destination": "/self-hosting/overview"
740+
},
738741
{
739742
"source": "/v3/open-source-self-hosting",
740-
"destination": "/open-source-self-hosting"
743+
"destination": "/self-hosting/overview"
741744
},
742745
{
743746
"source": "/v3/:slug*",

docs/github-repo.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ url: "https://github.com/triggerdotdev/trigger.dev"
55

66
Trigger.dev is [Open Source on GitHub](https://github.com/triggerdotdev/trigger.dev). You can contribute to the project by submitting issues, pull requests, or simply by using it and providing feedback.
77

8-
You can also [self-host](/open-source-self-hosting) the project if you want to run it on your own infrastructure.
8+
You can also [self-host](/self-hosting/overview) the project if you want to run it on your own infrastructure.

0 commit comments

Comments
 (0)