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

Validation has incorrect caching of stale schema version #213

Open
tillig opened this issue May 8, 2023 · 1 comment
Open

Validation has incorrect caching of stale schema version #213

tillig opened this issue May 8, 2023 · 1 comment

Comments

@tillig
Copy link
Contributor

tillig commented May 8, 2023

Describe the bug

As I'm working on a spec I will see errors pop up (correctly) indicating that I've violated some rule or other. As I update the specification and correct the errors, it appears revalidation still finds those errors. Watching the validation happening in the Spectral output window, I definitely see it finding errors that aren't there anymore.

I can then jump over to my web browser (like now) and, without changing anything, see the Spectral linting get kicked off, like it's a queue of validation requests that have somehow been delayed against stale versions of the document. The "dam broke" and the old requests for validation suddenly started going through but instead of being the latest copy of the document, it's a cached version - the version that was there when the request to lint got kicked off.

That queue logic/explanation sort of makes sense - since that is pretty much how validation gets kicked off. I remember I grabbed that from the (MIT licensed) ESLint plugin implementation and I don't know if perhaps they've figured out some improvements to the mechanism or something since the Spectral extension started.

This seems to happen more with large schemas (e.g., 2700 lines, 20 paths, 50 operations) rather than smaller schemas (maybe 1000 lines, 10 paths, etc.). Unclear if there's a tie between memory usage or schema size and the delay here.

@tillig
Copy link
Contributor Author

tillig commented May 19, 2023

I've verified that rolling back to 1.1.0 seems to resolve the delay/caching problem. I don't see much that happened between 1.1.0 and 1.1.2 other than some package updates, so something in there is going to be the problem.

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

No branches or pull requests

1 participant