Skip to content

Conversation

@phanthaiduong22
Copy link
Member

Summary of the changes (Less than 80 chars)

  • Describe the bug

  • How to fix:
    Add the expected header x-ms-error-code for responses from the API that checks for existence in the emulator (CheckConnectionExistence, CheckGroupExistence, CheckUserExistence). The expected value of x-ms-error-code should be the same as what is defined in management to avoid throwing exceptions in this function.

    return FilterExpectedResponse(response, ErrorCodes.WarningConnectionNotExisted);

Fixes #1912

@phanthaiduong22 phanthaiduong22 self-assigned this Aug 7, 2024
@phanthaiduong22 phanthaiduong22 requested a review from vicancy August 7, 2024 18:00
@phanthaiduong22 phanthaiduong22 changed the title fix emulator response unexpected Header:x-ms-error-code Fix emulator response unexpected Header:x-ms-error-code Aug 7, 2024
@zackliu
Copy link
Member

zackliu commented Aug 8, 2024

There're some other methods that can also return NotFound. They need to add ErrorCode as well.

@zackliu
Copy link
Member

zackliu commented Aug 8, 2024

Try to add some unit tests under test/Microsoft.Azure.SignalR.Emulator.Tests

@phanthaiduong22
Copy link
Member Author

hi @zackliu

I have resolved the review. Can u help double check that I can use: Error.Connection.NotExisted for both functions: RemoveConnectionFromGroup and AddConnectionToGroup. I have self-tested the sample (Management) with the emulator after resolving about changing from concrete class to interface. It works now. If everything is ok, I think we can merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ClientManager.ConnectionExistsAsync throws exception on expected 404 response from emulator

3 participants