Add group state messages in protobuf protocol#38751
Open
Y-Sindo wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends @azure/web-pubsub-client-protobuf to support the new group state message shapes in the protobuf-based protocol, aligning the protocol implementation and tests with the group state message types available in @azure/web-pubsub-client.
Changes:
- Added protobuf schema definitions for group state upstream/downstream messages (
SetGroupState,SubscribeGroupState,UnsubscribeGroupState,GroupStateSnapshot,GroupStateUpdate) and generated typings updates. - Implemented parsing of group state downstream messages and writing of group state upstream messages in
WebPubSubProtobufProtocolBase. - Added unit tests covering group state protobuf encoding/decoding, and bumped package version/changelog entry.
Reviewed changes
Copilot reviewed 5 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/web-pubsub/web-pubsub-client-protobuf/test/client.spec.ts | Adds encode/decode test coverage for group state messages and adjusts parse test typing. |
| sdk/web-pubsub/web-pubsub-client-protobuf/src/webPubSubProtobufProtocolBase.ts | Adds write/parse support for group state messages in the protobuf protocol implementation. |
| sdk/web-pubsub/web-pubsub-client-protobuf/src/protos/client.proto | Extends the protobuf schema with group state message definitions. |
| sdk/web-pubsub/web-pubsub-client-protobuf/src/generated/clientProto.d.ts | Updates generated TypeScript typings to reflect the new protobuf messages. |
| sdk/web-pubsub/web-pubsub-client-protobuf/package.json | Bumps package version and updates dependency on @azure/web-pubsub-client. |
| sdk/web-pubsub/web-pubsub-client-protobuf/CHANGELOG.md | Records the new group state message support and dependency change. |
| pnpm-lock.yaml | Updates workspace lockfile to match dependency changes. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comment on lines
56
to
60
| "sideEffects": false, | ||
| "dependencies": { | ||
| "@azure/logger": "^1.1.4", | ||
| "@azure/web-pubsub-client": "1.0.0-beta.2", | ||
| "@azure/web-pubsub-client": "workspace:^", | ||
| "long": "^5.3.1", |
Comment on lines
+7
to
+9
| - Added protobuf protocol support for group state messages (`setGroupState`, `subscribeGroupState`, `unsubscribeGroupState`, `groupStateSnapshot`, `groupStateUpdate`). | ||
| - Updated dependency `@azure/web-pubsub-client` to workspace reference for using group state types. | ||
|
|
Comment on lines
+198
to
+202
| const setGroupState = UpstreamMessage.SetGroupStateMessage.create({ | ||
| group: message.group, | ||
| ackId: message.ackId, | ||
| state: message.state !== undefined ? { entries: message.state } : null, | ||
| } as UpstreamMessage.ISetGroupStateMessage); |
Comment on lines
312
to
+315
| const buffer = Buffer.from(message, "base64"); | ||
| const parsedMsg = protocol.parseMessages(buffer); | ||
| const parsedMsg = protocol.parseMessages(buffer) as WebPubSubMessage | null; | ||
| assertFunc(parsedMsg!); | ||
| }); |
Comment on lines
+429
to
431
| const buffer = Buffer.from(message, "base64"); | ||
| const parsedMsg = protocol.parseMessages(buffer) as WebPubSubMessage | null; | ||
| assertFunc(parsedMsg!); |
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.
Packages impacted by this PR
web-pubsub-client-protobuf
Checklists