Skip to content

Conversation

@cnderrauber
Copy link
Contributor

  • Resend reliable message from last sequence received by server after connection resumed
  • Report last received reliable message from other participants on resuming

* Resend reliable message from last sequence received by server after connection resumed
* Report last received reliable message from other participants on
  resuming
@cnderrauber cnderrauber requested review from davidzhao and lukasIO June 11, 2025 05:24
@changeset-bot
Copy link

changeset-bot bot commented Jun 11, 2025

🦋 Changeset detected

Latest commit: e8eeb92

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
livekit-client Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
dist/livekit-client.esm.mjs 78.87 KB (+1.01% 🔺)
dist/livekit-client.umd.js 84.77 KB (+0.92% 🔺)

// make sure we do have a data connection
await this.ensurePublisherConnected(kind);

if (kind === DataPacket_Kind.RELIABLE) {
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, thinking this.ensurePublisherConnection might race for parallel sendDataPacket s so I'm not sure if it's guaranteed to respect invocation order.

Copy link
Contributor Author

@cnderrauber cnderrauber Jun 12, 2025

Choose a reason for hiding this comment

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

There is no await between increase sequence and dc.Send so the messages in the wire are in order and we can guaranteed the message has been received in the order which is sent. The sendxxx methods are async so I think the developer needs to wait for the first call completed before the next call if the message order is matter?

Copy link
Contributor

@lukasIO lukasIO Jun 13, 2025

Choose a reason for hiding this comment

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

yeah, that's right.
I just wonder what happens to our buffer logic here if the message order doesn't match the sequence number.
We simply pop and don't really look at the actual sequence number order in the buffer, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, the message order in the buffer should be same as the sequence number. I assume the message will be in order since there is no async statements between increase the number and push to buffer, is it wrong in the typescript?

Copy link
Contributor

Choose a reason for hiding this comment

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

got it, yeah, I think your assumption is correct!

@cnderrauber cnderrauber merged commit 2afafa7 into main Jun 13, 2025
6 checks passed
@cnderrauber cnderrauber deleted the dc_reliability branch June 13, 2025 13:58
svajunas-budrys pushed a commit to svajunas-budrys/client-sdk-js that referenced this pull request Jun 17, 2025
pblazej added a commit to livekit/client-sdk-swift that referenced this pull request Aug 5, 2025
Ports basic concepts from
livekit/client-sdk-js#1546

The differences are mostly syntactic, due to how backpressure is handled
via events in Swift. Thus, I decided to separate `SendBuffer` that's
tightly coupled to RTC and `RetryBuffer` with slightly different
semantics.
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.

3 participants