Skip to content

Commit

Permalink
Fix sending session client over webrtc (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
njooma authored Oct 22, 2024
1 parent 423f525 commit b0464d8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/src/rpc/web_rtc/web_rtc_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ class WebRtcClientChannel extends ClientChannelBase {

@override
ClientCall<Q, R> createCall<Q, R>(ClientMethod<Q, R> method, Stream<Q> requests, CallOptions options) {
final sessionMetadata = _sessionId();

// _sessionId will return '' empty if sessions are not enabled.
if (sessionMetadata.isNotEmpty && !SessionsClient.unallowedMethods.contains(method.path)) {
options = options.mergedWith(CallOptions(metadata: {SessionsClient.sessionMetadataKey: sessionMetadata}));
if (!SessionsClient.unallowedMethods.contains(method.path)) {
final sessionMetadata = _sessionId();
if (sessionMetadata.isNotEmpty) {
options = options.mergedWith(CallOptions(metadata: {SessionsClient.sessionMetadataKey: sessionMetadata}));
}
}
options = options.mergedWith(CallOptions(metadata: {'viam_client': getVersionMetadata()}));
return super.createCall(method, requests, options);
Expand Down

0 comments on commit b0464d8

Please sign in to comment.