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: prevent one-time handlers from incorrectly marking themselves as used #1822

Merged
merged 1 commit into from
Nov 1, 2023
Merged

fix: prevent one-time handlers from incorrectly marking themselves as used #1822

merged 1 commit into from
Nov 1, 2023

Conversation

joshkel
Copy link
Contributor

@joshkel joshkel commented Nov 1, 2023

In MSW 2, 'once' handlers are flagged as used, even if they don't match the request. This fixes that issue.

Add tests, based on b2baefc #1782 (comment)

In MSW 2, 'once' handlers are flagged as used, even if they don't match the request. This fixes that
issue.

Add tests, based on

- b2baefc
- #1782 (comment)

fix #1782
@kettanaito kettanaito changed the title fix(requesthandler): fix 'once' handling if handler doesn't match fix: prevent one-time handlers from incorrectly marking themselves as used Nov 1, 2023
Copy link
Member

@kettanaito kettanaito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Let's see what the CI tells us.

@kettanaito
Copy link
Member

Thanks for fixing this, @joshkel! Welcome to contributors! 🎉

@kettanaito kettanaito merged commit a179b68 into mswjs:main Nov 1, 2023
8 checks passed
@joshkel joshkel deleted the fix/once-handlers branch November 1, 2023 15:27
@kettanaito
Copy link
Member

Released: v2.0.2 🎉

This has been released in v2.0.2!

Make sure to always update to the latest version (npm i msw@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.

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.

All once handlers are being flagged as used as soon as a request is intercepted, no matter the URL
2 participants