Repository navigation
fix: read the camelCase keys of the roomConfig claim - #1244
Open
RaphaelFakhri wants to merge 1 commit into
Open
RaphaelFakhri wants to merge 1 commit into
RaphaelFakhri wants to merge 1 commit into
Conversation
RaphaelFakhri
requested review from
changt,
cloudwebrtc,
hiroshihorie and
xianshijing-lk
as code owners
October 17, 2026 14:51
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1243.
RoomConfigurationandRoomAgentDispatchread only snake_case keys such asagent_name,empty_timeoutandmax_participants. That matches the token endpoint request format, but LiveKit tokens write theroomConfigclaim as protobuf JSON with camelCase keys (agentName,emptyTimeout,maxParticipants). The Go (protojson.Marshalinlivekit/protocolauth/grants.go), Python (MessageToDict) and Node server SDKs all produce camelCase keys. As a result,TokenSourceResponse.jwtPayload?.roomConfigurationreturned null for every field exceptname,metadataand theagentslist, and each agent had a nullagentName.This change:
RoomConfiguration.fromJsonandRoomAgentDispatch.fromJsonfall back to the camelCase key when the snake_case key is absent, the same wayTokenSourceResponse.fromJsonalready accepts both forms.toJsonunchanged, so token endpoint requests still use snake_case keys.Test plan
test/token/token_source_test.dart: the newparses room configuration from the camelCase keys of the roomConfig claimtest builds a token with the keys that LiveKit tokens use and checks every field.Expected: <300>, Actual: <null>onconfig.emptyTimeout. After the change it passes.flutter test,flutter analyze,dart format --set-exit-if-changedandimport_sorterpass..changesentry.