feat: Add timeout handling for remote message sends and URL redemptions #713
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.
Closes #657
Add 10-second timeout for network message sends and 30-second timeout for URL redemptions using AbortSignal.timeout. Both timeouts clean up pending operations and trigger appropriate error handling. Includes comprehensive test coverage for timeout scenarios.
Note
Adds 10s timeout for network writes and 30s timeout for ocap URL redemption using AbortSignal.timeout, with cleanup, reconnection handling, and comprehensive tests aided by a new AbortSignal mock.
RemoteHandle.redeemOcapURL:AbortSignal.timeout; race reply vs. timeout; clean pending map and listeners on completion/error.remotes/network.ts:writeWithTimeout(channel, message, 10_000)usingAbortSignal.timeout.writeWithTimeoutinsendRemoteMessageandflushQueuedMessages; on timeout, log, requeue, and trigger reconnection.RemoteHandle.test.ts: add timeout tests for URL redemption, including cleanup assertions.network.test.ts: add "message send timeout" suite covering hangs, success-before-timeout, concurrent writes, and error propagation.packages/repo-tools/src/test-utils/abort-signal.tswithmakeAbortSignalMock; export fromtest-utils/index.ts.vitest.config.ts.Written by Cursor Bugbot for commit 198ac7c. This will update automatically on new commits. Configure here.