Skip to content

fix(schema): qualify wildcard cache keys by definition - #3421

Merged
tstirrat15 merged 3 commits into
authzed:mainfrom
josephschorr:fix/3418-wildcard-cache
Oct 22, 2026
Merged

tstirrat15 merged 3 commits into
authzed:mainfrom
josephschorr:fix/3418-wildcard-cache

Conversation

@josephschorr

Copy link
Copy Markdown
Member

The wildcard-check cache is shared across definitions but was keyed only by relation name. A negative result for ty1#rel0 could hide the wildcard in ty3#rel0, causing the same schema to be accepted or rejected depending on validation order. A cached positive result could also incorrectly affect an unrelated definition.

Key cached results by the full definition#relation reference. Add deterministic regression tests covering both cache orders and the reported schema after validating an unrelated definition.

Fixes #3418

Validation:

  • Regression tests failed before the fix and passed afterward.
  • Schema package passes with race detection; regressions also passed 100 runs with race detection.
  • go run mage.go test:unit: 107 packages passed. pkg/cmd/TestDefaultConfig failed because port 50051 was already occupied by Docker; the same failure was reproduced on unchanged main.

@josephschorr
josephschorr requested a review from a team as a code owner October 20, 2026 15:42
@github-actions github-actions Bot added the area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) label Oct 20, 2026
@codecov

codecov Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

tstirrat15
tstirrat15 previously approved these changes Oct 20, 2026

@tstirrat15 tstirrat15 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@josephschorr
josephschorr force-pushed the fix/3418-wildcard-cache branch from e550baf to e6dbe8f Compare October 20, 2026 20:30

@tstirrat15 tstirrat15 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@tstirrat15
tstirrat15 enabled auto-merge (squash) October 22, 2026 17:50
@tstirrat15
tstirrat15 merged commit 5fedd8f into authzed:main Oct 22, 2026
45 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WriteSchema nondeterministically accepts a schema that includes a wildcard transitively

2 participants