Skip to content

On Normal Closure the app doesn't retry even when shouldRetry set to true #449

Answered by enisdenjo
OttlikG asked this question in Q&A
Discussion options

You must be logged in to vote

Hey there, close code 1000: Normal Closure means we're good and done - it should not be used as a problematic close code. graphql-ws intentionally skips this code and will not retry it:

graphql-ws/src/client.ts

Lines 841 to 844 in eea18ce

// normal closure (possibly all subscriptions have completed)
// if no locks were acquired in the meantime, shouldnt try again
if (isLikeCloseEvent(errOrCloseEvent) && errOrCloseEvent.code === 1000)
return locks > 0;

Consider using 1001: Going Away, or even 1012: Service Restart, or 1013: Try Again Later, as a better-fitting indicator that the server is being restarted.

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@OttlikG
Comment options

Answer selected by enisdenjo
Comment options

You must be logged in to vote
1 reply
@enisdenjo
Comment options

Comment options

You must be logged in to vote
1 reply
@enisdenjo
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #446 on February 17, 2023 16:39.