Closed GregVS closed 1 year ago
Merging #1368 (26174e3) into main (d41edf5) will increase coverage by
0.43%
. The diff coverage is100.00%
.:exclamation: Current head 26174e3 differs from pull request most recent head 8587340. Consider uploading reports for the commit 8587340 to get more accurate results
@@ Coverage Diff @@
## main #1368 +/- ##
==========================================
+ Coverage 64.19% 64.63% +0.43%
==========================================
Files 41 41
Lines 1715 1719 +4
==========================================
+ Hits 1101 1111 +10
+ Misses 614 608 -6
Files Changed | Coverage Δ | |
---|---|---|
...lib/src/links/websocket_link/websocket_client.dart | 83.33% <100.00%> (+0.72%) |
:arrow_up: |
Looks like that this PR is breaking the CI
Ok will look into it when I get the chance
@GregVS Any update on this? I am going to prepare the new beta release, so if you want this in this is a good moment to fix the CI
I can confirm this.
subscription.cancel()
doesn't send to server complete message.
Also if the client doesn't listens to any subscription should disconnect.
The javascript client has a lazy option which is true by default.
Controls when should the connection be established.
false
: Establish a connection immediately. UseonNonLazyError
to handle errors.true
: Establish a connection on first subscribe and close on last unsubscribe. Use the subscription sink's error to handle errors.
About closing web socket connection, client sends complete on subscription -> wait for server complete response then closes connection. Basically on receiving complete message from server if number of subscriptions is zero -> close connection Next time you subscribe you open a new connection.
I did the work for you and fixed also the commit header.
But I change also the rules of how to get the review on a PR https://github.com/zino-hofmann/graphql-flutter/pull/1375
BTW, Thanks to work on this
According to the
graphql-transport-ws
protocol, when the client is closing a subscription, it is supposed to send aComplete
message. Currently this library handles sending thestop
operation forgraphql-ws
protocol, but is not in compliance with the graphql-transport-ws procedure. Consequently, the server does not close it's subscription with the client and resources are being consumed. Therefore, I have added code to provide this proper behavior which tells the server that the client no longer wishes to receive additional message.