Skip to content

Conversation

@sirtimid
Copy link
Contributor

@sirtimid sirtimid commented Dec 5, 2025

Closes #686

This PR does the following:

  • When a remote connection is lost and retries are exhausted, all promises for which that remote is the decider are now rejected, including promises from queued messages that were never delivered.
  • Exposes maxRetryAttempts and maxQueue as configurable options for remote communications initialization, converts the relays parameter to an options object for future extensibility.
  • Fixes a bug where maxRetryAttempts was not being respected due to resetBackoff being called too early in the reconnection flow.

Note

Reject promises when remote connections are abandoned; switch remote comms init to options (relays/maxRetryAttempts/maxQueue) and tighten reconnection/backoff behavior across stack.

  • Remote Comms (ocap-kernel):
    • Add remoteGiveUp RPC (kernel-remote) and propagate from server to kernel; RemoteManager rejects pending URL redemptions and all promises decided by the remote on give-up.
    • Change initRemoteComms to accept RemoteCommsOptions (relays, maxRetryAttempts, maxQueue); persist relays; update PlatformServices/types accordingly.
    • Fix reconnection flow: respect maxRetryAttempts, reset backoff only after successful flush, queue flushing merges hints, intentional close handling, wake detector backoff reset; ConnectionFactory accepts maxRetryAttempts.
    • Minor: getPromisesByDecider now uses EndpointId.
  • Platform Services:
    • Browser/Node servers and clients updated to new options API; add handling for remoteGiveUp (client callback, server forwards via RPC).
    • Kernel calls remoteManager.cleanup() on stop; worker init uses kernel.initRemoteComms({ relays }).
  • Tests/Coverage:
    • Extensive unit/e2e tests added/updated for give-up, options, reconnection, queues, hints; coverage thresholds adjusted.

Written by Cursor Bugbot for commit 232de02. This will update automatically on new commits. Configure here.

@sirtimid sirtimid force-pushed the sirtimid/handling-unresolved-promises branch from 917b7a8 to bfd7d4a Compare December 10, 2025 22:21
@sirtimid sirtimid changed the title [WIP] feat: reject promises on connection loss feat: reject promises on connection loss Dec 10, 2025
@sirtimid sirtimid marked this pull request as ready for review December 10, 2025 23:20
@sirtimid sirtimid requested a review from a team as a code owner December 10, 2025 23:20
cursor[bot]

This comment was marked as resolved.

@MetaMask MetaMask deleted a comment from cursor bot Dec 11, 2025
@sirtimid sirtimid force-pushed the sirtimid/handling-unresolved-promises branch from f95a717 to 9750de6 Compare December 11, 2025 18:29
@sirtimid sirtimid force-pushed the sirtimid/handling-unresolved-promises branch from 9750de6 to 54d9636 Compare December 16, 2025 17:22
@sirtimid sirtimid requested a review from rekmarks December 16, 2025 17:30
Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Some questions / comments.

@sirtimid sirtimid requested a review from rekmarks December 16, 2025 20:24
rekmarks
rekmarks previously approved these changes Dec 16, 2025
Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but see the robot's most recent review.

@sirtimid sirtimid enabled auto-merge (squash) December 16, 2025 21:29
@sirtimid sirtimid merged commit a5042e7 into main Dec 16, 2025
26 checks passed
@sirtimid sirtimid deleted the sirtimid/handling-unresolved-promises branch December 16, 2025 21:34
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.

Remote comms: Promise rejection on give-up

3 participants