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.
Related to #161, #337, #332
.ConfigureAwait(false)
on all awaits in library codeCanReconnectWithSameObservable
Those overall changes seem to have considerably stabilized the unit tests, at least they run consistently across my dev machine and GitHub actions.
@sungam3r I'd like a second opinion on the changes regarding the
CanReconnectWithSameObservable
test case, I'll try to elaborate a bit on how the behaviour of the GraphQL client has changed through this (relevant changes in cff7f5f):The test uses the Chat schema adopted from the server project (with some modifications), which uses a
ReplaySubject<1>
for it's message stream. The intentional design of this is that on subscribing to this stream the last message is played back on the client.Up to now this library has created a hot observable for each subscription, cached it inside
GraphQLHttpClient
and returned the already created observable instance for repeated subscriptions with an equal request object. This caused theaforementioned test case to fail on this line, where the second subscription expects to receive the replayed last chat message. But since the underlying GraphQL subscription did not terminate here but instead was reused, the server did not even notice that the subscription was disposed on the client side (don't ask me how this test has passed sometimes in the past 🙈 ).
Now the client does not try to reuse subscriptions any more and passes
.Subscribe()
and.Dispose()
transparenty to the server. This includes creating two identical simultaneous subscriptions, which would then send the same data twice over the websocket connection.IMO the old behaviour introduced incomprehensible behaviour, which is much worse than sending data twice, which can and should be prevented by the client application code.
I'd appreciate your feedback.