Skip to content

Conversation

@ivanauth
Copy link
Contributor

Description

Fixes #578. The built-in SpiceDB server in the MCP server did not have expiration support enabled by default, preventing users from using expirations in their schemas.

Changes

  • Add server.WithEnableRelationshipExpiration(true) to the MCP server configuration

Testing

  • Existing tests pass
  • The MCP server uses memdb (in-memory datastore) which supports all features without migrations

Signed-off-by: ivanauth <ivan@authzed.com>
@codecov-commenter
Copy link

codecov-commenter commented Jan 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 42.48%. Comparing base (ec981d0) to head (5a38136).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #618   +/-   ##
=======================================
  Coverage   42.48%   42.48%           
=======================================
  Files          38       38           
  Lines        5030     5030           
=======================================
  Hits         2137     2137           
  Misses       2638     2638           
  Partials      255      255           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: ivanauth <ivan@authzed.com>
The test TestConcurrentBatchWhenOneBatchFailsAndWorkersIsOne was flaky
because there was a race between the semaphore release and errgroup's
context cancellation. When a batch failed, it would release the
semaphore (via defer) before errgroup cancelled the context, allowing
the next iteration's sem.Acquire to succeed and execute an additional
batch.

Fix this by using an atomic.Bool flag that is set immediately when a
batch returns an error. The main loop checks this flag after acquiring
the semaphore, ensuring no new batches are launched after a failure.
@ivanauth ivanauth force-pushed the fix/issue-578-enable-expiration-mcp branch from c038a45 to 14cb05f Compare January 23, 2026 15:32
tstirrat15
tstirrat15 previously approved these changes Jan 23, 2026
Copy link
Contributor

@tstirrat15 tstirrat15 left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +77 to +78
# NOTE: wasmbrowsertest can have flaky websocket timeouts, so we retry up to 3 times
uses: "nick-fields/retry@v3"
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't like that we need this but this seems like a sane approach.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, agreed - not ideal. The wasmbrowsertest websocket connections just time out randomly in CI, and we've had a few runs fail because of it. Figured a retry with a timeout cap was the least invasive way to stop it from blocking PRs.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this refactor necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call - dropped it from this PR. I think it's a real race but low impact, I'll submit it separately if we want it.

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

Successfully merging this pull request may close these issues.

Enable expiration support by default for SpiceDB Dev MCP server

3 participants