-
Notifications
You must be signed in to change notification settings - Fork 406
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
fix(store): add setting that allows disabling dual error handling #1971
Conversation
e07aa28
to
5ea35e0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this is a great addition, but I'm unsure about the name.
What other names have you thought about?
@arturovt could you describe the two different modes? Could you summarize each mode with details of behavior under each mode? This will go a long way to help with naming. |
Upon reviewing this, is suspect that there may actually be a fix that allows this to work as expected in all cases. could be to do with the Do you remember the motivation for this new microtask? |
BundleMonFiles updated (1)
Unchanged files (2)
Total files change +1.65KB +1.58% Groups updated (3)
Final result: ❌ View report in BundleMon website ➡️ |
BundleMon (NGXS Plugins)Unchanged files (14)
No change in files bundle size Unchanged groups (3)
Final result: ✅ View report in BundleMon website ➡️ |
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 4a913cf. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 3 targetsSent with 💌 from NxCloud. |
BundleMon (Integration Projects)Files updated (2)
Total files change +80B +0.06% Final result: ✅ View report in BundleMon website ➡️ |
8fd2b17
to
4a913cf
Compare
☁️ Nx Cloud ReportCI is running/has finished running commands for commit a070882. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 3 targetsSent with 💌 from NxCloud. |
Code Climate has analyzed commit a070882 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 95.5% (0.0% change). View more on Code Climate. |
I had a discussion with @arturovt and we closed this PR in favour of another approach that will be taken in an upcoming PR. |
Issue: #1965
NGXS has had an explicit error-handling mechanism from actions for the last years. However, this caused issues with
ErrorHandler
being called twice with the same error. The explicit error handling mechanism is required because of the NGXS action handling strategy. The default action handling process leaves the Angular zone, so NGXS actions are invoked in the<root>
zone context. All caught actions must be returned to the Angular error handler.Angular's default error-handling mechanism requires zone.js to be bundled. The forked Angular zone has an
onHandleError
hook which callszone.onError.emit(error)
when any error is being caught in Angular zone. Angular subscribes toonError
when callsbootstrapModuleFactory
:This PR adds "switchers" between explicit and implicit error-handling mechanisms. We either catch them manually and delegate them to
handleError
or allow Angular to catch errors in its zone and delegate them tohandleError
.We would use the old behavior where we catch errors explicitly to be backward-compatible and allow users to switch to the implicit behavior where zone.js is responsible for catching errors and delegating them to Angular.