docs(openapi): document the 503 five more routes already answer - #1163
Merged
Conversation
The four group participant writes and the label chat read answer 503 today but
published only their success statuses, so a client generated from the contract
had no branch for a failure the gateway was already returning.
Both are blind spots of the derivation that documented the other thirty rather
than new behaviour, and they fail it in different ways:
- The participant writes delegate to a PRIVATE helper. addParticipants,
removeParticipants, promoteParticipants and demoteParticipants each contain
a single forwarding call; the bounded call lives one level deeper, inside
runParticipantsUpdate. A derivation matching "delegate method containing a
bounded call" sees four methods containing none. Bounded since 0.14.5.
- The label chat read has no request budget at all. Its 503 comes from a
direct EngineTransportError on the whatsapp-web.js side, thrown when the
page connection dies mid-read, so a sweep anchored on the deadline helper
cannot see it. It has answered 503 since 0.14.0 - five releases undocumented,
with an adapter spec asserting it that whole time.
The wording differs accordingly. The participant 503 is the one status that
separates "WhatsApp never answered" from the per-participant refusals a 200
reports inside `results`, and it is shared by all four through one constant.
Reusing the request-budget sentence on the label route would have documented a
deadline that route does not have.
A structural test keys the invariant off the response schema rather than a list
of paths, so a fifth participant route inherits it instead of slipping past the
same way these four did. It fails if the 503 is dropped, and its non-empty guard
fails if the schema is renamed out from under the selector.
Deliberately unchanged: creating a group, creating a channel and the media send
path stay unbounded and undeclared, for the reason CHANGELOG [0.14.5] gives -
they are non-idempotent and the Go SDK retries POST on 503.
No runtime behaviour changes; every 503 here was already reachable.
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
Five routes answer
503today and published only their success statuses. This adds the missing@ApiResponsedeclarations and regenerates the snapshot. No runtime behaviour changes — every503here was already reachable.POST /sessions/{id}/groups/{groupId}/participants200DELETE /sessions/{id}/groups/{groupId}/participants200POST /sessions/{id}/groups/{groupId}/participants/promote200POST /sessions/{id}/groups/{groupId}/participants/demote200GET /sessions/{id}/labels/{labelId}/chats200,400,501CHANGELOG [0.14.5]already states the participant writes "now answer503", so the changelog was right and the contract was the part left behind.Why the previous pass missed them
#1149 derived its set from delegate methods containing a bounded call. These five fail that derivation in two different ways, which is worth recording so the next sweep does not repeat it:
The participant writes hide the bounded call one level down.
addParticipants,removeParticipants,promoteParticipantsanddemoteParticipantseach contain a single forwarding call and nothing else; the deadline lives inside the privaterunParticipantsUpdatethey all delegate to. A derivation matching "method containing a bounded call" sees four methods containing none.The label read has no request budget at all. Its
503comes from anEngineTransportErrorthrown directly on the whatsapp-web.js side when the page connection dies mid-read. A sweep anchored on the deadline helper cannot see it by construction. It has been undocumented for five releases, withwhatsapp-web-js.adapter.spec.tsasserting the behaviour that whole time.Why the two descriptions differ
The participant
503is the one status that separates "WhatsApp never answered" from the per-participant refusals a200already reports insideresults— an unanswered query yields[], which the empty-results guard would otherwise turn into a403, selling a dead transport as a permissions problem. All four share one constant so the four cannot drift apart.The label route has no deadline, so reusing the request-budget sentence there would have documented a mechanism that route does not have. It gets wording about the page connection instead.
Test
The structural invariant in
openapi-contract.spec.tsis keyed off the response schema rather than a list of paths, so a fifth participant route inherits it rather than slipping past the way these four did. It was checked in both directions: dropping the503from one route fails it, and renaming the schema fails the non-empty guard rather than passing vacuously.Deliberately unchanged
Creating a group, creating a channel and the media send path stay unbounded and undeclared, for the reason
CHANGELOG [0.14.5]gives — they are non-idempotent and the Go SDK retriesPOSTon503, so declaring it there would break the interlock.Out of scope, noted for follow-up
403(EngineRefusedError, on a total refusal or an empty result) and do not declare it.GET /labels/{labelId}/chatscan answer404(LabelNotFoundError, unknown label) and does not declare it.@ApiResponsesurface at all.openapi.jsonis copied into the docs repository; that snapshot needs refreshing, and the API-conventions and troubleshooting pages can now claim the503for these routes.Verification
openapi:check,lint,format:check,tsc --noEmit,build, dashboardbuildall exit 0;npm testpasses 5119 tests across 300 suites.openapi.jsonwas regenerated withnpm run openapi:export, never edited by hand.Refs #1149