Skip to content

Change /_publish-realm to be async#5325

Draft
backspace wants to merge 3 commits into
mainfrom
publish-async-cs-11362
Draft

Change /_publish-realm to be async#5325
backspace wants to merge 3 commits into
mainfrom
publish-async-cs-11362

Conversation

@backspace

Copy link
Copy Markdown
Contributor

The caller can use /_readiness-check to see when indexing is complete.

Also, publishing has been indexing twice … TBC

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Preview deployments

Host Test Results

    1 files  ± 0      1 suites  ±0   1h 43m 27s ⏱️ -1s
3 200 tests +24  3 178 ✅ +19  15 💤 ±0  0 ❌ ±0  7 🔥 +5 
3 219 runs  +24  3 190 ✅ +14  15 💤 ±0  7 ❌ +5  7 🔥 +5 

Results for commit 3314869. ± Comparison against earlier commit f112c6b.

For more details on these errors, see this check.

Realm Server Test Results

    1 files  ±  0      1 suites  ±0   8m 24s ⏱️ - 2m 46s
1 373 tests +285  1 372 ✅ +285  0 💤 ±0  1 ❌ ±0 
1 453 runs  +308  1 452 ✅ +308  0 💤 ±0  1 ❌ ±0 

Results for commit 3314869. ± Comparison against earlier commit f112c6b.

For more details on these errors, see this check.

The async publish handler returned 202 without mounting the published
realm on this instance, relying on lazy-mount-on-request to serve it.
That left freshly-published realms 404ing until something mounted them,
which lazy-mount did not reliably do on the publishing instance.

Mount the realm via reconciler.lookupOrMount without awaiting it:
ensureMounted publishes the realm into virtualNetwork synchronously, so
it is served as soon as the 202 returns, while start()'s from-scratch
index runs in the background and clients poll _readiness-check. For a
republish (already mounted) the follow-up kicks fullIndex to reindex the
swapped files.

Tests: index-responses reconciles before the readiness check; the host
publish command test stubs waitForRealmReady at the service level (its
network mock could not match subdirectory readiness pollers).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant