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: Keep track of dirty ranges when requests are inflight so they supercede incoming matches #190

Merged

Conversation

jonathonherbert
Copy link
Contributor

What does this change?

When Typerighter's operating in realtime mode (requestMatchesOnDocModified = true), it keeps track of dirtied ranges, and ensures that any ranges dirtied whilst a request for that range is in flight invalidate matches made in that request.

In non-realtime mode, it ... doesn't. See #189.

This change corrects that oversight, ensuring that dirtied ranges are tracked whilst requests are in flight. Once the request is complete, dirtiedRanges is reset, and ranges are no longer tracked.

How to test

@jonathonherbert jonathonherbert requested a review from a team December 13, 2021 10:27
Base automatically changed from jsh/do-not-allow-matches-that-fall-outside-doc to main December 13, 2021 11:28
@jonathonherbert jonathonherbert force-pushed the jsh/keep-dirtied-ranges-whilst-checks-are-inflight branch from 08ac996 to 8f681f2 Compare December 13, 2021 12:31
Copy link
Contributor

@SHession SHession left a comment

Choose a reason for hiding this comment

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

Changes make sense and tests look good. I have also attempted to replicate this issue locally and have been unsuccessful. LGTM!

@jonathonherbert jonathonherbert merged commit 039a453 into main Jan 6, 2022
@github-actions
Copy link

github-actions bot commented Jan 6, 2022

🎉 This PR is included in version 5.11.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jonathonherbert jonathonherbert deleted the jsh/keep-dirtied-ranges-whilst-checks-are-inflight branch March 3, 2022 20:17
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.

None yet

2 participants