Fix delete/get/list_dispatch: keyword auth_header + ClientResp .data unwrap#91
Closed
trialize wants to merge 1 commit into
Closed
Conversation
…nwrap
delete_dispatch, get_dispatch and list_dispatch pass the grant positionally to AuthMixin#auth_header, which only accepts the `video_grant:` keyword, so every call raises ArgumentError ("wrong number of arguments (given 1, expected 0)") before reaching the server. create_dispatch is the only method that passes it correctly.
get_dispatch and list_dispatch additionally read .agent_dispatches directly off the Twirp::ClientResp returned by rpc, rather than its .data payload — a latent NoMethodError the auth_header bug masked.
Pass video_grant: and unwrap res.data in all three methods.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
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.
Problem
AgentDispatchServiceClient#delete_dispatch,#get_dispatch, and#list_dispatchare unusable as shipped:Positional grant →
ArgumentError. All three pass the grant positionally toAuthMixin#auth_header, which only accepts thevideo_grant:keyword:Every call raises
ArgumentError: wrong number of arguments (given 1, expected 0)fromauth_mixin.rbbefore any request is sent.#create_dispatchis the only method that passes the keyword correctly.res.agent_dispatchesoff aClientResp.#get_dispatch/#list_dispatchreadres.agent_dispatchesdirectly off theTwirp::ClientRespreturned byrpc, instead ofres.data.agent_dispatches— aNoMethodErrorthat the first bug masked.Fix
Minimal: pass
video_grant:and unwrapres.datain the three methods.#create_dispatchis unchanged.Verification
Against a live LiveKit server:
create_dispatch→list_dispatch(shows the dispatch) →delete_dispatch→list_dispatch(gone), all returning cleanly. Before the fix each of the three raisedArgumentErrorfromauth_mixin.rb.