fix(mpc): make create point to participant add instead of a 405 - #98
Merged
Merged
Conversation
Plivo has no create-MPC API: the MultiPartyCall collection is GET-only, so create always got a 405. An MPC starts when its first participant is added, which `participant add <name>` already does. create now sends nothing and needs no credentials or --yes. It exits BAD_INPUT with that command as the hint, is hidden from help and docs, and keeps its old flags so existing scripts reach the guidance.
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.
What
plivo voice multiparty createcould never succeed. It POSTed to/v1/Account/{auth_id}/MultiPartyCall/, but that collection is GET-only in Plivo's API, so every call got a 405. There is no create-MPC endpoint: an MPC starts when its first participant is added, andplivo voice multiparty participant add <name>already does that. It posts toname_<name>/Participant/, and Plivo creates the MPC if no ongoing call with that name exists.Change
createnow sends nothing and needs no credentials or--yes. It exitsBAD_INPUT(exit 1) with a hint to runplivo voice multiparty participant add <name> --from <number> --to <number> --role agent --yes.Hidden, so it no longer shows in help,docs/COMMANDS.mdor completion. It stays registered with its old flags, none required, so existing scripts get the guidance rather than "unknown command" or "unknown flag".Hiddenwas chosen over cobra'sDeprecatedbecauseDeprecatedprints an extra stderr line in front of the JSON error envelope.cli-skill/SKILL.mddropscreateand notes thatparticipant add <name>starts the MPC.participant additself is unchanged; its dry-run output is byte-identical.Tests
cmd/mpc_test.gohas two cases: the old flags plus--yesagainst a server that records every request, and a barecreatewhile logged out. Both assert that nothing is sent, the error isBAD_INPUTwith exit 1, and the hint names the realparticipant addcommand path. Against the old code the first case caught the POST and the second failed on the required--name.create. Help goldens changed only forvoice multipartyandvoice multiparty create.go test -race ./...,golangci-lint run,GOOS=windows go build ./...,scripts/smoke.sh, andmake docsdrift.