Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a nonce to data messages. #606

Merged
merged 8 commits into from
Jan 27, 2025
Merged

Add a nonce to data messages. #606

merged 8 commits into from
Jan 27, 2025

Conversation

boks1971
Copy link
Contributor

@boks1971 boks1971 commented Jan 26, 2025

Using unix nano as nonce.
Use 128-bit UUID bytes as nonce.

Using unix nano as nonce.
@boks1971 boks1971 marked this pull request as draft January 26, 2025 18:04
roomclient.go Outdated
@@ -132,6 +133,8 @@ func (c *RoomServiceClient) SendData(ctx context.Context, req *livekit.SendDataR
if err != nil {
return nil, err
}
// add a nonce to enable receiver to de-dupe
req.Nonce = mono.UnixNano()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using monotonic unix nano as nonce, but it probably requires a different mechanism which can be replicated in all server sdks.

Copy link
Contributor

@paulwe paulwe Jan 26, 2025

Choose a reason for hiding this comment

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

maybe the high n (48?) bits could be random and the low bits could be a counter? or a 128bit uuid?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay, will make a 128 but UUID. Not sure if counter would be useful.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Switched to 128-bit UUID in this commit - 2c9472e

@boks1971 boks1971 requested a review from a team January 27, 2025 07:55
@boks1971 boks1971 marked this pull request as ready for review January 27, 2025 07:55
@boks1971 boks1971 merged commit 6d9a741 into main Jan 27, 2025
2 checks passed
@boks1971 boks1971 deleted the raja_data_nonce branch January 27, 2025 10:40
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