Skip to content

fix: run engineReady before the web server listens - #28

Merged
obany merged 1 commit into
nextfrom
bugfix/engine-ready-before-listen
Oct 26, 2026
Merged

obany merged 1 commit into
nextfrom
bugfix/engine-ready-before-listen

Conversation

@obany

@obany obany commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

📝 Description

Adds an optional engineReady callback to EngineServer.start which runs once the engine has started and the routes are built, before the web server listens, so a host can finish setup the route processors depend on before the first request is served.

🔄 Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • ⚡ Performance improvement
  • ♻️ Code refactoring
  • 📦 Dependencies update

🛠️ Changes Made

  • Add the optional engineReady parameter to start on IEngineServer and EngineServer
  • Call it after the web server is built and before it starts listening; if it throws, the engine is stopped as for any other start failure
  • The node seeds its authorization model after start returns, so /readyz reported ready about 1.1 s (Bun) or 0.33 s (Node) before the model existed and early authenticated requests were rejected with 403; the node will pass its seeding through engineReady instead
  • Document the callback in the engine-server examples

🧪 Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this change manually
  • Testing not required for changes

@obany
obany merged commit 7b90952 into next Oct 26, 2026
2 checks passed
@obany
obany deleted the bugfix/engine-ready-before-listen branch October 26, 2026 07:27
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