-
Notifications
You must be signed in to change notification settings - Fork 552
Closed
Description
Component
provider, pubsub
Describe the feature you would like
fix for #1601 which outlined a race condition when we retrieve the subscription for the first time, this is because we drop the the rx here:
| let (tx, _rx) = broadcast::channel(channel_size); |
and by the time
let mut sub = ws_provider.root().get_subscription(sub_id).await?;
we only subscribe to new values.
| RawSubscription { rx: self.tx.subscribe(), local_id: self.local_id } |
we can fix this race in two ways
- either change the set up in such a way that
request.set_is_subscription();
let sub_id = request.await?;
this directly awaits into a subscription
- don't drop the receiver until the first subscription is retrieved
we can do both 1 and 2 imo, 2 should fix this issue right away
Additional context
No response
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
Completed