Conversation
Pass `cors: true` for permissive defaults or `cors: { ...headers }` for custom CORS headers. Preflight (OPTIONS) requests are handled automatically for matched routes, and CORS headers are appended to all non-WebSocket responses — including responses returned by `onBeforeRequest`.
Fix a bug where reconnect() could not start a new connection after maxRetries was exhausted because _connectLock was not released in _connect(). Set _connectLock = false on the early return when max retries are reached. Added a test (reconnecting.test.ts) that reproduces the issue and verifies reconnect() works after retries are exhausted, and included a changeset entry documenting the patch.
Add tests for a hibernating server that verify setName/onStart initialization behavior: onStart runs before processing connections, runs only once with concurrent connections/requests, and that websocket messages work after initialization. Implement HibernatingOnStartServer (hibernate: true) with a delayed onStart that increments a counter, plus onConnect/onMessage/onRequest handlers that expose the counter. Update tests/worker imports and wrangler.toml to register the new Durable Object binding and include it in migrations.
Introduce an AlarmServer Durable Object and test to verify that alarms initialize the DO and call onAlarm without redundant blockConcurrencyWhile. Changes: add AlarmServer class (hibernate:true) with counter and alarmCount, implement onStart/onAlarm/onRequest; export AlarmServer in the test Env; import runDurableObjectAlarm and add a test that schedules an alarm, triggers it via runDurableObjectAlarm, and asserts onStart and alarmCount behavior; register AlarmServer in wrangler.jsonc. This ensures alarm-triggered initialization works as expected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )