Skip to content

Restore subscriptions after relay reconnects - #17

Closed
riccardobl with Copilot wants to merge 2 commits into
masterfrom
copilot/feature-add-getter-autoreconnect
Closed

Restore subscriptions after relay reconnects#17
riccardobl with Copilot wants to merge 2 commits into
masterfrom
copilot/feature-add-getter-autoreconnect

Conversation

Copilot AI commented Aug 3, 2026

Copy link
Copy Markdown

Subscriptions were lost when relay connections dropped, with no API to determine whether a subscription remained active. This change preserves subscription state and restores it automatically after reconnection.

  • Subscription status
    • Add getSubscription() and hasSubscription() accessors.
  • Reconnect recovery
    • Persist each subscription’s REQ payload and relay targets.
    • Requeue matching REQ messages when a relay reports CONNECTED.
    • Reset EOSE state so restored subscriptions receive fresh stored events.
  • Tests
    • Cover subscription lookup, removal, and reconnect restoration.
if (pool.hasSubscription(subId)) {
    auto *subscription = pool.getSubscription(subId);
}

Copilot AI changed the title [WIP] Add getter and autoreconnect for subscriptions Restore subscriptions after relay reconnects Aug 3, 2026
Copilot AI requested a review from riccardobl August 3, 2026 15:36
@riccardobl
riccardobl marked this pull request as ready for review August 3, 2026 15:39
@riccardobl riccardobl closed this Aug 3, 2026
@riccardobl riccardobl reopened this Aug 3, 2026
@riccardobl riccardobl closed this Aug 3, 2026
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.

Feature request: Add getter and autoreconnect for subscriptions

2 participants