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

fix(store): enable throwing errors from selectors by default #2111

Merged
merged 1 commit into from
Mar 15, 2024

Conversation

arturovt
Copy link
Member

@arturovt arturovt commented Mar 15, 2024

This commit updates the suppressErrors configuration property to default to falsy.
Consequently, if the selector function throws a type error (such as when accessing a
property unsafely), the error will now be thrown.

selectSnapshot will throw synchronously, while errors from select will be thrown
asynchronously because the RxJS error reporter operates within a setTimeout.

We log errors in development mode to assist developers in identifying selectors that have thrown.

This change is breaking and is part of the v4 release preparation.

Copy link

nx-cloud bot commented Mar 15, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 4fb898e. 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 4 targets

Sent with 💌 from NxCloud.

Copy link

bundlemon bot commented Mar 15, 2024

BundleMon (Integration Projects)

Files updated (2)
Status Path Size Limits
Main bundles(Gzip)
hello-world-ng16/dist-integration/main.(hash)
.js
66.98KB (+111B +0.16%) +1%
Main bundles(Gzip)
hello-world-ng17/dist-integration/main.(hash)
.js
68.48KB (+105B +0.15%) +1%

Total files change +216B +0.16%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

This commit updates the `suppressErrors` configuration property to default to falsy.
Consequently, if the selector function throws a type error (such as when accessing a
property unsafely), the error will now be thrown.

`selectSnapshot` will throw synchronously, while errors from `select` will be thrown
asynchronously because the RxJS error reporter operates within a `setTimeout`.

We log errors in development mode to assist developers in identifying selectors that have thrown.

This change is breaking and is part of the v4 release preparation.
Copy link

codeclimate bot commented Mar 15, 2024

Code Climate has analyzed commit 4fb898e 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.4% (0.0% change).

View more on Code Climate.

@arturovt arturovt marked this pull request as ready for review March 15, 2024 19:47
@arturovt arturovt merged commit a59c9ba into master Mar 15, 2024
12 checks passed
@arturovt arturovt deleted the fix/supress-errors branch March 15, 2024 19:48
@markwhitfeld markwhitfeld added this to the v.18.0.0 milestone Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants