/__mesh__/control: app.upgrade and the Node listener disagree for a user @Ws route #126

Closed
opened 2026-10-10 23:22:28 +00:00 by chrnx · 2 comments
Owner

The core #123 parity corpus captures this.

On an app without mesh, a user route @Ws('/__mesh__/control') behaves differently depending on the adapter:

  • app.upgrade (Deno/Bun/edge) refuses it with 1008;
  • the Node 'upgrade' listener serves it.

Expected: one rule on every adapter. Either the path is always reserved and declaring it fails at boot with a clear error (the simpler option), or it is reserved only when mesh is enabled.

Fixing this changes a frozen capture, so the corpus update needs explicit approval.

The core #123 parity corpus captures this. On an app **without** mesh, a user route `@Ws('/__mesh__/control')` behaves differently depending on the adapter: - `app.upgrade` (Deno/Bun/edge) refuses it with `1008`; - the Node `'upgrade'` listener serves it. Expected: one rule on every adapter. Either the path is always reserved and declaring it fails at boot with a clear error (the simpler option), or it is reserved only when mesh is enabled. Fixing this changes a frozen capture, so the corpus update needs explicit approval.
Author
Owner

Merged into develop in #141 (CARD-21, FPRD-001c, 2026-10-23). Left open until the 1c acceptance gate (CARD-22), per the 1a/1b convention.

Merged into develop in #141 (CARD-21, FPRD-001c, 2026-10-23). Left open until the 1c acceptance gate (CARD-22), per the 1a/1b convention.
Author
Owner

Fixed in 26.11.0-rc.1 (f494fc2, 2c00cc3). From the changelog:

  • /__mesh__/control is reserved in every app, mesh or not (#126). A @Ws, @Stream or HTTP route that claims it — @Ws('/__mesh__/control'), @Get('/__mesh__/control'), @Ws('/__mesh__/:x'), /__mesh__/:rest*, or a mountpoint that adds up to one of these — now fails createApp, naming the declaration and the reserved path. A route exported by a teapot is checked the same way, and fails the teacup's boot. Before, the Node listener served a user route there whenever no mesh control channel was configured, while app.upgrade (Deno, Bun, the edge) always refused it, so the same route worked on one runtime and not the others. A pattern whose first segment is not the literal __mesh__ (/:org/:repo, /:rest*) still boots; the reserved path is answered ahead of the route table on every runtime, so such a route never sees it. To migrate, move the route to another path, for example /mesh/control. Nothing replaces /__mesh__/control itself: it never reached the route on Deno, Bun or the edge. An upgrade to /__mesh__/control on an app with no control channel is now refused identically everywhere: the Node listener accepts it and closes 1008 with mesh control channel not enabled: this app exports nothing, or has no mesh.secret, as app.upgrade already did. An app with no @Ws/@Stream routes and no mesh attaches no upgrade listener on Node, as before, so there the request still reaches the HTTP route table.
Fixed in **26.11.0-rc.1** (`f494fc2`, `2c00cc3`). From the changelog: - **`/__mesh__/control` is reserved in every app, mesh or not** (#126). A `@Ws`, `@Stream` or HTTP route that claims it — `@Ws('/__mesh__/control')`, `@Get('/__mesh__/control')`, `@Ws('/__mesh__/:x')`, `/__mesh__/:rest*`, or a mountpoint that adds up to one of these — now fails `createApp`, naming the declaration and the reserved path. A route exported by a teapot is checked the same way, and fails the teacup's boot. Before, the Node listener served a user route there whenever no mesh control channel was configured, while `app.upgrade` (Deno, Bun, the edge) always refused it, so the same route worked on one runtime and not the others. A pattern whose first segment is not the literal `__mesh__` (`/:org/:repo`, `/:rest*`) still boots; the reserved path is answered ahead of the route table on every runtime, so such a route never sees it. To migrate, move the route to another path, for example `/mesh/control`. Nothing replaces `/__mesh__/control` itself: it never reached the route on Deno, Bun or the edge. An upgrade to `/__mesh__/control` on an app with no control channel is now refused identically everywhere: the Node listener accepts it and closes `1008` with `mesh control channel not enabled: this app exports nothing, or has no mesh.secret`, as `app.upgrade` already did. An app with no `@Ws`/`@Stream` routes and no mesh attaches no upgrade listener on Node, as before, so there the request still reaches the HTTP route table.
chrnx closed this issue 2026-11-18 01:04:14 +00:00
Sign in to join this conversation.