-
Notifications
You must be signed in to change notification settings - Fork 166
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
Change publishData signature #946
Conversation
🦋 Changeset detectedLatest commit: 9ee0aab The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
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.
I think it's still kind of tricky for someone who's using the options
interface to realize it's changed for them. Either of the following could overcome that:
- separate identity spec from
destination
field so that it'sdestinationIdentities
- create a type for Participant.Identity so that it would be impossible to mix up with a standard string.
That's true. But unsure what the right way to make this more obvious would be.
this is not ideal as the accepted type is
if we let the type be equal to What do you think about renaming it to |
size-limit report 📦
|
what I meant is separating them so it's not bundled together
My main hope is that users will realize it no longer compiles and specifically set identities field. If it's simply renaming a field, they would not bother reading the details of the change. |
what happens when both are set? Does it result in the message being receivend by both added together or does one field take precedence over the other? I think as a user I would feel confused whether I have to set both of them or not.
Yeah that makes sense. But it's a major change after all. Our migration guide should make this clear. |
What do you think about throwing an exception? Just an idea tho. It's your decision on which path we ended up taking. |
}); | ||
} | ||
async publishData(data: Uint8Array, options: DataPublishOptions = {}): Promise<void> { | ||
const kind = options.reliable ? DataPacket_Kind.RELIABLE : DataPacket_Kind.LOSSY; |
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.
Not sure if I'm reading the code correctly but DataPublishOptions.reliable
is null by default so this will default to LOSSY
?
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.
yeah, LOSSY
by default is what is intended!
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.
lgtm!
I think for this one we'll have to live with a hard change as we simultaneously want to switch from using
sids
toidentities
which I don't think we could easily do in a backwards compatible way in a deprecation step. (We'd need to figure out if the user intends to set sids or identities)