Skip to content

Let an isolated application with a host use fastifyRoutes #3051

Description

@dawsontoth

Problem

fastifyRoutes refuses to load under any host mount (server/fastifyRoutes.ts:43-55). The reason given is that fastify is registered as a global fallback, so its routes would answer on every host.

That reasoning doesn't hold in an isolated application's dedicated worker:

  • The worker loads only that application.
  • It's reached only through its host's SNI route, so there's no other host for the routes to leak onto.

Isolated applications need a host to be reachable at all (#2757), so today a fastify-based application can't be isolated. Studio's component is one of them.

Proposal

Skip the refusal when the scope's application is this thread's isolated application (thisThreadsIsolatedApplication()). Keep it in shared workers.

Part of #3042.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    Priority

    P2

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions