Data track schema definition storage - #2050
Conversation
🦋 Changeset detectedLatest commit: 34b7c29 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 |
size-limit report 📦
|
ea10e84 to
34b7c29
Compare
| if (this.onDataTrackSubscriberHandles) { | ||
| this.onDataTrackSubscriberHandles(msg.value); | ||
| } | ||
| } else if (msg.case === 'storeDataBlobResponse') { |
There was a problem hiding this comment.
probably this is too late now, but curious to learn why the success path isn't using the existing RequestResponse format, too
There was a problem hiding this comment.
Great question, this is because typically a RequestResponse contains a copy of the request. However, in this case, since the request's payload is potentially large, it didn't make sense to echo the whole thing back if there is an error.
| * is responsible for ensuring it is well-formed. | ||
| * @param signal Optional abort signal to cancel the request. | ||
| */ | ||
| async defineSchema( |
There was a problem hiding this comment.
I know this doesn't really exist as a pattern in this SDK right now, but I'm wondering if we should scope these new methods to a dedicated localParticipant.dataTracks.* namespace so that it's clear what they relate to.
Consistency across SDKs is the biggest factor though, so it ultimately only makes sense if we want to commit to that pattern also for other SDKs.
I find localP.defineSchema sounds a bit too generic to be a data-track only feature.
There was a problem hiding this comment.
Yes, this is currently what the API looks like in Rust and C++. However, I do like scoping this somehow. Another idea I had is having it under localParticpant.schemaRegistry. I think adoption of this feature is early enough that we could justify marking the current APIs as deprecated and scoping them. For additional context, data blobs support, which is the prerequisite to using this feature, isn't enabled for all projects in cloud yet.
Adds support for defining/retrieving data track schema definitions through new methods on local participant. Under the hood, this is powered by data blobs.
Mirrors the implementation in: livekit/rust-sdks#1159.
Usage (publisher):
Usage (subscriber):