Repository navigation
fix(core): bound durable media usage projection work - #2422
Conversation
🦋 Changeset detectedLatest commit: 6af474b 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-cache | 6af474b | Aug 11 2026, 06:26 PM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-playground | 6af474b | Aug 11 2026, 06:26 PM |
Scope checkThis PR changes 1,570 lines across 18 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. |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-demo-do | 6af474b | Aug 11 2026, 06:28 PM |
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. |
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/auth-atproto
@emdash-cms/blocks
@emdash-cms/cloudflare
@emdash-cms/contentful-to-portable-text
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/plugin-cli
@emdash-cms/plugin-types
@emdash-cms/registry-client
@emdash-cms/registry-lexicons
@emdash-cms/registry-verification
@emdash-cms/sandbox-workerd
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-field-kit
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
There was a problem hiding this comment.
This is a focused, well-scoped bug fix that bounds durable Media Usage projection work before it mutates the index. The approach is sound: add admission control to the durable work path, keep the synchronous V1 refresh path unchanged, preserve exact unchanged oversized projections as no-ops, and defer or fail oversized work cleanly. The implementation follows the existing generation-guarded write patterns and EmDash conventions.
I read the full diff, the changed source files, and the test fixtures. I checked for:
- SQL safety in the new deletion-measurement query (parameterized, no raw identifier interpolation).
- Correctness of the admission cost model and budget mutation semantics.
- Behavior at the occurrence and byte boundaries.
- Whether
hasReservedMutationcorrectly stops in-process conflict retries after a reservation. - Whether the V1 synchronous refresh path remains unbounded.
- Whether new queries hit content tables without locale filters (they don't; the changes are against media-usage system tables and the existing content-row lookup is unchanged).
- Whether the return-type change of
buildMediaUsageProjectionFingerprintis fully handled (onlycontent-snapshots.tsand tests call it). - Whether tests cover the new behaviors: admission planner, terminal failures, no-op preservation, oversized cleanup, legacy path, and D1/workerd boundary.
I found no logic bugs, security issues, regressions, or AGENTS.md violations. The changeset is present and appropriate. This looks ready to merge as-is.
What does this PR do?
Bounds one durable Media Usage projection job before it mutates the index.
Follow-up to #2394.
Type of change
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change)pnpm formathas been runAI-generated code disclosure
Screenshots / test output
No visual changes.
pnpm typecheckpnpm lintpnpm --filter emdash build/varversus/private/varpath-alias assertionpnpm --filter emdash test:workerd: real D1/workerd boundary passespnpm query-counts: SQLite query counts and query text unchangedpnpm exec changeset statusPostgreSQL parity tests were not run because
EMDASH_TEST_PGis not configured locally.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-projection-admission. Updated automatically when the playground redeploys.