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

Ability to catch promise rejections from background refreshes #637

Merged
merged 1 commit into from Feb 17, 2024

Conversation

Kauhsa
Copy link
Contributor

@Kauhsa Kauhsa commented Jan 30, 2024

This PR introduces onBackgroundRefreshError configuration option, which makes it possible to handle promise rejections originating from background refreshes.

As it stands now, depending on your Node version, process might crash. process.on('uncaughtException', ...) fixes that, but we missed a bit more... targeted approach to handling these errors, so here is a PR.

src/caching.ts Show resolved Hide resolved
@Kauhsa Kauhsa force-pushed the on-background-refresh-error branch 2 times, most recently from 4a40bc2 to 6e35c40 Compare January 30, 2024 13:39
@Kauhsa Kauhsa marked this pull request as ready for review January 30, 2024 14:05
test/utils.ts Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Jan 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2f69cc9) 100.00% compared to head (10b8d98) 100.00%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #637   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          320       327    +7     
  Branches        79        81    +2     
=========================================
+ Hits           320       327    +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jaredwray
Copy link
Owner

@Kauhsa can we get an update on this?

@Kauhsa
Copy link
Contributor Author

Kauhsa commented Feb 16, 2024

@Kauhsa can we get an update on this?

Sure. Rebased (if that is what you meant).

@jaredwray
Copy link
Owner

@Kauhsa - thanks so much for adding this in and updating the readme. We will get this published in the next couple weeks.

@jaredwray jaredwray merged commit 9f54a0c into jaredwray:master Feb 17, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants