Skip to content

Fastify native close, server framework matrix - #61

Merged
bisubus merged 33 commits into
masterfrom
feat-server-framework-native
Nov 4, 2026
Merged

bisubus merged 33 commits into
masterfrom
feat-server-framework-native

Conversation

@bisubus

@bisubus bisubus commented Nov 4, 2026

Copy link
Copy Markdown
Member

Summary

@cancjs/server-fastify now finishes its shutdown inside fastify's own app.close(). A plain await app.close() lets in-flight requests finish with Connection: close and cancels the ones still running at cancelAfter, instead of resetting them or waiting on idle kept-alive connections. createShutdown(app, options) stores the options that close uses, and its shutdown() runs app.close(). Fastify cuts the close off at pluginTimeout (10 s by default), so inside fastify's close the windows are lowered to end just under it and app.log.warn reports that once; an Infinity window is lowered too, and pluginTimeout: 0 keeps it.

The server adapters are now tested against their oldest and newest supported framework versions. A framework parity spec runs the same cancel, deadline and shutdown cases through express, fastify, hono, koa and node, and a CI job server-framework-matrix runs the server suites at the floor versions and at the latest.

@cancjs/server-hono raises its peer floors to hono >=4.8.0 and @hono/node-server >=1.9.0, the oldest releases it is tested against. It stops @hono/node-server 2 from logging ERR_HTTP_HEADERS_SENT for a response cut after its head was sent, and cancelErrorHandler() logs an error the request does not own the way Hono does, with the bare error passed to console.error.

Testing

  • npm run build, npm run surface:check, npm run surface:removals, npm run check:brand-keys and npm pack --dry-run for the five server packages pass on a fresh build.
  • Server suites at the framework floor: parity 32, express 85, fastify 100, hono 90, koa 82, node 324 tests pass; fastify also passes on 5.10.0.
  • CI passes on the head, including server-framework-matrix at the floor and at the latest.

Breaking changes

  • @cancjs/server-fastify: a request that arrives on a kept-alive connection during the shutdown is answered by fastify, with 503 unless return503OnClosing is false, instead of being served. Set return503OnClosing: false to keep serving such requests.
  • @cancjs/server-hono: peers hono 4.0 to 4.7 and @hono/node-server 1.0 to 1.8 are no longer supported; those users get a peer conflict and must upgrade.

@bisubus
bisubus merged commit d50a054 into master Nov 4, 2026
72 checks passed
@bisubus
bisubus deleted the feat-server-framework-native branch November 4, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant