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: defer validation of reference entries #12990

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ascorbic
Copy link
Contributor

@ascorbic ascorbic commented Jan 15, 2025

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

Copy link

changeset-bot bot commented Jan 15, 2025

🦋 Changeset detected

Latest 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

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Jan 15, 2025
Copy link

codspeed-hq bot commented Jan 15, 2025

CodSpeed Performance Report

Merging #12990 will not alter performance

Comparing defer-reference-validation (9cd2105) with main (1a026af)

Summary

✅ 6 untouched benchmarks

@ascorbic ascorbic marked this pull request as ready for review January 15, 2025 18:28
@florian-lefebvre
Copy link
Member

Are references still checked during build?

@ascorbic
Copy link
Contributor Author

@florian-lefebvre they're checked during rendering, which is what we already do for uncached builds now anyway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
2 participants