Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ngrxPush pipe is swallowing errors silently #3100

Closed
maxime1992 opened this issue Jul 28, 2021 · 0 comments · Fixed by #3101
Closed

ngrxPush pipe is swallowing errors silently #3100

maxime1992 opened this issue Jul 28, 2021 · 0 comments · Fixed by #3101
Labels
community watch Someone from the community is working this issue/PR Project: Component

Comments

@maxime1992
Copy link
Contributor

maxime1992 commented Jul 28, 2021

Minimal reproduction of the bug/regression with instructions:

https://stackblitz.com/edit/angular-ivy-qvtpja?file=src/app/app.component.ts

  • Install @ngrx/component
  • Create an observable that emits a value (just so that we know we've correctly subscribed to it) and then which errors after some time
  • Subscribe to it from the view twice:
    • With the async pipe: It will report the error correctly in the console
    • With the ngrxPush pipe: It won't report any error at all but the observable is in an error state and we won't receive any update which is super confusing

This happened and we were all super confused at work. Why is our view partially rendered (table getting all the rows asynchronously), while we've got no errors at all?

We opened our Redux devtool and saw that all of our data where there so it wasn't coming from the effect nor the reducers.

Eventually, figured out that it was coming from one of our selectors because an interface was poorly implemented at first and we were accessing a field which was sometimes null (therefore throwing an error from the selector, which was silently swallowed by the ngrxPush pipe).

I read the whole documentation about this pipe and nothing mentions that behavior: https://ngrx.io/guide/component/push

async pipe ngrxPush pipe
image image

Expected behavior:

Same behavior as the async pipe: throw errors instead of swallowing them silently.

This will let us notice while developing that something is wrong in the first place and it'll also let us correctly report to Sentry or any other provider that something went wrong and should be fixed.

Versions of NgRx, Angular, Node, affected browser(s) and operating system(s):

  • @ngrx/component: 12.3.0

Other information:

It seems to come from here:

catchError((e) => {
return EMPTY;
})

I would be willing to submit a PR to fix this issue

[x] Yes (Assistance is provided if you need help submitting a pull request) --> Done here so we have something to discuss at least 😸 #3101
[ ] No

maxime1992 added a commit to maxime1992/platform that referenced this issue Jul 28, 2021
@timdeschryver timdeschryver added Project: Component community watch Someone from the community is working this issue/PR labels Jul 28, 2021
brandonroberts pushed a commit that referenced this issue Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community watch Someone from the community is working this issue/PR Project: Component
Projects
None yet
2 participants