Open LarsKrogJensen opened 6 years ago
Maybe you could you hook retryIf:
const retryLink = new RetryLink({
delay: {
initial: 500,
max: Infinity,
jitter: true
},
attempts: {
max: 5,
retryIf: (error, _operation) => {
console.log("Retrying ...");
return !!error;
}
}
});
With a reference to the retryLink instance, you can assign new retryIf and delayFor functions on the fly.
Maybe adding some callbacks would be the best way to go. onFirstRetry, onReconnect, onLastFailedAttempt. Or maybe an onRetry passing the retry count to the callback. In this way the implementation of the error notifications is separated from the lib
When the retry-links an error it silently continues to poll without notifying in any way, the UI is thus unaware it is potentially is displaying out-of-date information.
A suggestion is to inform that an error has occurred and continue to poll.