NgRx Effect subscription terminates after unhandled error in createEffect pipeline
0 reputation · 28 Aug 2022, 04:45 UTC
Context
An NgRx Effect created with createEffect listens for a specific action type and performs an asynchronous operation. When the inner observable emits an error and no catchError operator is present in the pipeline, the effect's subscription completes.
Goal
Determine whether the completed subscription can be automatically resubscribed by the NgRx runtime or if the effect permanently stops responding to subsequent actions of the same type.
Constraints
The application uses classic NgRx Store/Effects (not Signal Store) with RxJS 7.x. The effect must remain responsive after transient failures such as network timeouts or third-party API errors. Adding catchError to every effect is the recommended pattern, but the team wants to understand the default failure behavior before adopting a project-wide error-handling strategy.
Questions
- Does NgRx internally resubscribe to an effect after its source observable errors and completes, or is the effect permanently disabled for that action type?
- If resubscription occurs, what conditions trigger it (e.g., next dispatched action, store reinitialization)?
- Are there version-specific differences in this behavior between NgRx 14, 15, and 16 that would affect the decision?