-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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: defer validation of reference entries #12990
Conversation
🦋 Changeset detectedLatest commit: 9cd2105 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
CodSpeed Performance ReportMerging #12990 will not alter performanceComparing Summary
|
Are references still checked during build? |
@florian-lefebvre they're checked during rendering, which is what we already do for uncached builds now anyway |
So they wouldn't be caught in on-demand routes. I think it would make sense to always check references after all loaders are loaded (to avoid race conditions) during uncached builds, let me know what you think |
The problem is that these validations are happening in the loaders, when users call |
I am thinking I may need to move to a post-sync validation step, but it's hard to think how to do it without it being a breaking change |
Changes
Currently we attempt to validate references in schemas by checking the referenced entry exists. This causes a problem if a new referenced entry is added at the same time as the reference is added, because there can be a race condition where the referenced entry has not yet been added to the store when the reference is validated.
This PR removes that check. This is OK (and we already skip validation if the collection doesn't exist yet) because we also validate at runtime.
Fixes #12680
Fixes #12885
Testing
Adds a test
Docs