fix(sdk): give subscribe-presence its own request type - #1408
Merged
Conversation
`SubscribePresenceDto` had no contract-shape coverage at all. Four clients declared one `MarkChatRequest` for both `subscribePresence` and `markUnread`, and the gate mapped that type to `MarkChatUnreadDto`, so the pair being compared was not the pair that exists. The two DTOs are identical today, which is the only reason nothing failed; a field added to either would have gone unnoticed on every typed client. Each of the four typed clients now declares `SubscribePresenceRequest`, the gate maps it to `SubscribePresenceDto`, and the per-client coverage floors rise by one so the pair cannot be dropped again in silence. Comparisons go from 320 to 324. BREAKING for the Go and Java clients: `SubscribePresence` takes the new type. The wire body is unchanged.
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.
SubscribePresenceDtohad no contract-shape coverage at all, and nothing said so. Four typed clients declared oneMarkChatRequestfor bothsubscribePresenceandmarkUnread, and the gate mapped that type toMarkChatUnreadDto, so the pair being compared was not the pair that exists. The two DTOs are identical today, which is the only reason nothing failed; a field added to either would have gone unnoticed on every typed client, and the schema is not in the gate'sEXCLUDEDlist either.What changed
SubscribePresenceRequest, andsubscribePresencetakes it.MarkChatRequestnow servesmarkUnreadalone, which is what the gate already claimed.check-contract-shapesmaps the new type in all four tables, and each per-client coverage floor rises by one so the pair cannot be dropped again in silence. Comparisons go from 320 to 324.Impact
SubscribePresencetakes the new type, so a caller passingMarkChatRequestno longer compiles. Swap the type at the call site. JavaScript and Python are structurally typed and unaffected. The wire body is unchanged on every client, and no server behaviour changes.Verification
check-contract-shapesreports 324 pairs, four more than before, one per typed client. That count is the guard: had the new type not been harvested it would have stayed at 320 and the raised floors would have failed instead.go vet,go test -race, gofmt,mvn -B verify,mypy,pytest, and the JavaScript typecheck, tests and build.tsc --noEmit, format, openapi, the fourcheck:sdk-*gates, and the unit suite.