Skip to content

Allow more time for local synchronizer responses - #299

Open
dajiaohuang wants to merge 1 commit into
tinyplex:mainfrom
dajiaohuang:fix/local-synchronizer-timeout
Open

Allow more time for local synchronizer responses#299
dajiaohuang wants to merge 1 commit into
tinyplex:mainfrom
dajiaohuang:fix/local-synchronizer-timeout

Conversation

@dajiaohuang

Copy link
Copy Markdown

Summary

Fixes #298.

Restore the LocalSynchronizer request timeout from 10 ms to its earlier 50 ms value. Requests and responses are delivered asynchronously by timers; a 10 ms deadline can expire before an otherwise valid response arrives.

Add a fake-timer regression that delays each zero-delay delivery by 15 ms, and wait for convergence before the prepopulated bidirectional tests inspect their existing expected content and snapshots. No snapshots, dependencies, or public API are changed.

Tradeoff: a missing peer can take an additional 40 ms to time out. This provides headroom for the reproduced timer scheduling behavior, not a guarantee against arbitrary event-loop stalls.

How did you test this change?

  • Native compileForTest build passes.
  • New delayed-delivery test fails with the original timeout and passes with 50 ms.
  • Local synchronizer selection: 62 tests pass.
  • Middleware test file: all 336 tests pass, including both sync-back tests that failed with the original deadline on this machine.
  • Complete synchronizers file: 234 pass, 11 fail, all in the Custom Synchronizer mock, which uses its own unchanged 5 ms deadline. Removing the new convergence wait reproduces all eleven failures under the original wait logic. No snapshots were updated.
  • Source, test, and site TypeScript checks pass. The gulp ts wrapper then hits spawn npx ENOENT on Windows; running its two installed Svelte-check entrypoints directly gives zero errors/warnings in both workspaces.
  • Prettier, ESLint for the changed files, and git diff --check pass.

Environment: Windows, Node.js v24.14.1. Full repository test coverage is not claimed.

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.

LocalSynchronizer request timeout can expire before timer-delivered responses arrive

1 participant