Skip to content

Add group state messages in protobuf protocol#38751

Open
Y-Sindo wants to merge 2 commits into
Azure:mainfrom
Y-Sindo:groupstateprotocol
Open

Add group state messages in protobuf protocol#38751
Y-Sindo wants to merge 2 commits into
Azure:mainfrom
Y-Sindo:groupstateprotocol

Conversation

@Y-Sindo
Copy link
Copy Markdown
Member

@Y-Sindo Y-Sindo commented Jun 1, 2026

Packages impacted by this PR

web-pubsub-client-protobuf

Checklists

  • Added impacted package name to the issue description
  • [x Does this PR needs any fixes in the SDK Generator?** (If so, create an Issue in the Autorest/typescript repository and link it here)
  • Added a changelog (if necessary)

Copilot AI review requested due to automatic review settings June 1, 2026 04:31
@Y-Sindo Y-Sindo requested review from a team, chenkennt, jeremymeng, vicancy and zackliu as code owners June 1, 2026 04:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants