-
Notifications
You must be signed in to change notification settings - Fork 102
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
Conversation
Using unix nano as nonce.
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() |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Using unix nano as nonce.Use 128-bit UUID bytes as nonce.