Skip to content

Comments

fix(pubsub): treat pending subscriptions as local interest#602

Open
marcus-pousette wants to merge 1 commit intomasterfrom
codex/pubsub-pending-subscriptions
Open

fix(pubsub): treat pending subscriptions as local interest#602
marcus-pousette wants to merge 1 commit intomasterfrom
codex/pubsub-pending-subscriptions

Conversation

@marcus-pousette
Copy link
Member

Summary

  • make debounced subscribe(topic) intent explicit via pendingSubscriptions
  • treat pending topics as local interest for strict PubSubData delivery checks
  • include pending topics in subscription-overlap responses used by subscribe/request-subscriber handshakes
  • eagerly initialize topic tracking on subscribe() and clean it up when a pending subscribe is cancelled before debounce

Why

subscribe() is debounced. Without explicit pending intent, there is a window where strict targeted delivery can be dropped and overlap responses under-report local interest.

Tests

  • added regression: pending subscribe is tracked immediately and fully cleaned on cancel-before-debounce
  • added regression: strict direct PubSubData is accepted while subscribe is pending
  • verified with: pnpm --filter @peerbit/pubsub test (pass)

Scope

This PR intentionally includes only the pubsub pending-subscription behavior and tests (no shared-log/docs/tooling changes).

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.

1 participant