Skip to content

Pubsub only on specific connection, connection id and throttr server version bump.#28

Merged
Zen0x7 merged 4 commits intomasterfrom
pubsub-only-on-specific-connection
Jun 17, 2025
Merged

Pubsub only on specific connection, connection id and throttr server version bump.#28
Zen0x7 merged 4 commits intomasterfrom
pubsub-only-on-specific-connection

Conversation

@Zen0x7
Copy link
Copy Markdown
Contributor

@Zen0x7 Zen0x7 commented Jun 17, 2025

This patch include three things:

  1. Subscribe and unsubscribe must be done per connection:
const connection = await service.getConnection();
await connection.send({ 
    type: RequestType.Subscribe,
    channel: "abc",
    callback: (message: string) => console.log(message)
}

This resolve the problem at unsubscribe ...

await service.send({ 
    type: RequestType.Unsubscribe,
    channel: "abc"
}
// But subscription are per connection, which one?

Right way:

const connection = await service.getConnection();
await connection.send({ 
    type: RequestType.Subscribe,
    channel: "abc",
    ...
}

// Time to unsubscribe ...
await connection.send({ 
    type: RequestType.Unsubscribe,
    channel: "abc"
}
// This one.
  1. Connections now recover his connection id by doing WHOAMI request after connection stablished.
  2. SDK is marked as compatible with 5.0.7.

@Zen0x7 Zen0x7 self-assigned this Jun 17, 2025
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@Zen0x7 Zen0x7 changed the title Pubsub only on specific connection Pubsub only on specific connection and connection id Jun 17, 2025
@Zen0x7 Zen0x7 changed the title Pubsub only on specific connection and connection id Pubsub only on specific connection, connection id and throttr server version bump. Jun 17, 2025
@sonarqubecloud
Copy link
Copy Markdown

@Zen0x7 Zen0x7 merged commit 8a02a47 into master Jun 17, 2025
5 checks passed
@Zen0x7 Zen0x7 deleted the pubsub-only-on-specific-connection branch June 17, 2025 16:13
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.

2 participants