Add Azure Web PubSub emulator - #1048
Closed
Liangying.Wei (vicancy) wants to merge 14 commits into
Closed
Liangying.Wei (vicancy) wants to merge 14 commits into
Liangying.Wei (vicancy) wants to merge 14 commits into
Conversation
Address five defects found while reviewing the emulator: - The raw WebSocket path ignored the connection state returned by an event handler, so handler-provided state only survived on the JSON path. - A duplicate connection-state response header threw from SingleOrDefault and closed the connection; take the last value instead. - OData `or`/`and` used short-circuit operators, so an invalid right operand escaped validation whenever the left operand already decided the result. - The disconnected reason was derived from the recoverable flag, so the upstream `disconnected` event could not report the real close reason. - A user event with no handler and no listener acked `BadRequest` instead of `InternalServerError`. Adds regression tests covering both the raw and JSON client paths, plus an explicit test showing client pub/sub still works on a hub with no event handlers configured, since only synchronous user events require an upstream receiver. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b6cd2eff-482c-42de-85e8-731983f10535
Zhenghui Yan (vwxyzh)
approved these changes
Aug 26, 2026
Zhenghui Yan (vwxyzh)
approved these changes
Aug 27, 2026
Liangying.Wei (vicancy)
marked this pull request as draft
August 28, 2026 01:45
This was referenced Sep 3, 2026
This was referenced Sep 17, 2026
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.
Summary
Validation
dotnet test tools/emulator/tests/Microsoft.Azure.WebPubSub.Emulator.Tests/Microsoft.Azure.WebPubSub.Emulator.Tests.csproj --configuration Release --no-restore