You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
retryBackoff: an empty caughtError Observable ends the stream, and only its first value is emitted #282
The docs say: "The values of the Observable it returns are emitted before the retry". Two cases do not do this.
Reproduced in reactjrx tests:
caughtError: () => EMPTY, on a source that succeeds when subscribed the second time: 1 subscription, where 2 are expected. The stream completes, the error is lost, and there is no retry.
caughtError: () => of("a", "b"): emits ["a"], where ["a", "b"] is expected.
Why
retryBackoff.ts:74-81 rethrows the error with each value, through mergeMap((value) => merge(of(value), throwError(...))). The first value rethrows and ends the Observable, and an Observable with no value never rethrows.
Fix
Emit all the values, then rethrow: concat(caughtErrorResult$, throwError(() => error)). No API change.
Related: when retryAfter completes without a value, the original error is replaced by an rxjs EmptyError. A test pins this today ("errors with EmptyError when retryAfter completes without emitting"), but it loses the error that the caller would want.
Activity