Speed up automatic Media Usage indexing - #2539
Conversation
🦋 Changeset detectedLatest commit: 1fcbc86 The changes in this PR will be included in the next version bump. This PR includes changesets to release 17 packages
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 |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-demo-do | 1fcbc86 | Aug 18 2026, 10:43 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-playground | 1fcbc86 | Aug 18 2026, 10:43 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-demo-cache | 1fcbc86 | Aug 18 2026, 10:43 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
docs | 1fcbc86 | Aug 18 2026, 10:01 AM |
Scope checkThis PR changes 1,326 lines across 39 files. Large PRs are harder to review and more likely to be closed without review. If this scope is intentional, no action needed. A maintainer will review it. If not, please consider splitting this into smaller PRs. See CONTRIBUTING.md for contribution guidelines. |
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
Overlapping PRsThis PR modifies files that are also changed by other open PRs:
This may cause merge conflicts or duplicated work. A maintainer will coordinate. |
What does this PR do?
Speeds up automatic Media Usage indexing after activation without changing projection, coverage, deletion, or API semantics.
The new work-conserving engine skips idle maintenance classes and processes one existing bounded durable unit per turn. Node continues on event-loop timer turns. Cloudflare uses identity-free Queue wake messages with one consumer at a time, while D1 work rows, leases, retries, and Cron recovery remain authoritative.
This draft is stacked directly on PR #2531. It also includes a small out-of-scope admin fix discovered during deployed testing: incomplete locale catalogs now fall back to compiled English, preventing Media Usage progress from displaying raw plural syntax.
Deployed testing on an isolated D1 database completed 100 historical entries without loss or duplication, including pause and resume. The safe one-unit Queue path indexed first-to-last in about eight minutes; D1 SQL execution itself remained under one second, so Queue delivery latency is the dominant cost.
Draft follow-up before marking ready: the repository lock currently resolves Wrangler 4.100, while first-deploy Queue auto-provisioning was verified to require Wrangler 4.123+.
Related: #2531
Type of change
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change)pnpm formathas been runmessages.pochanges except in translation PRs — a workflow extracts catalogs on merge tomain.The locale checklist remains unchecked because this draft deliberately includes one source-catalog entry to reproduce and fix the deployed raw-ICU regression before the normal post-merge extraction workflow runs.
AI-generated code disclosure
Screenshots / test output
Try this PR
Open a fresh playground →
A full working EmDash site, deployed from this branch. Each visit gets its own session-scoped sandbox: no login needed and no shared state. Try the admin, edit content, hit the public site.
Tracks
feature/media-usage-work-conserving-backfill. Updated automatically when the playground redeploys.