Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpClient: Fixes HttpResponseMessage.RequestMessage is null in WASM #1875

Merged
merged 10 commits into from Sep 25, 2020

Conversation

ealsur
Copy link
Member

@ealsur ealsur commented Sep 24, 2020

Description

HttpClient on WebAssembly seems to behave a bit differently than in NET Core/FX. When doing a SendAsync, the resulting HttpResponseMessage does not have the RequestMessage property set to the originating HttpRequestMessage.

During Cache operations, if the operation fails with, for example, a 404, GatewayStoreClient will use GatewayStoreClient.CreateDocumentClientExceptionAsync to parse the HttpResponseMessage, and use the RequestMessage property to get the original Url, but this triggers a NullReferenceException in WASM (see linked Issue).

This PR makes sure to set the property in the CosmosHttpClient if the property is null after calling SendAsync.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Closing issues

Closes #1873

@ealsur ealsur added the bug Something isn't working label Sep 24, 2020
@ealsur ealsur self-assigned this Sep 24, 2020
@ealsur ealsur merged commit 8114e84 into master Sep 25, 2020
@ealsur ealsur deleted the users/ealsur/gwnullref branch September 25, 2020 15:24
@ghost
Copy link

ghost commented Dec 15, 2021

Closing due to in-activity, pease feel free to re-open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NullReferenceException on Gateway mode on WebAssembly
3 participants