fix(core): remove stale restampEntryPivot call that crashes content publish - #2466
Conversation
…ublish The merge of emdash-cms#2460 and emdash-cms#2461 left main with a publish path that calls restampEntryPivot, a method emdash-cms#2461 deleted together with the pivot denormalization it maintained. Every content publish now throws "this.restampEntryPivot is not a function". No replacement call is needed: since migration 068 the pivot columns the call re-stamped are legacy, and reads join the authoritative ec_* row.
🦋 Changeset detectedLatest commit: a7d92f3 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 |
@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 the right fix for the right problem. The leftover await this.restampEntryPivot(type, id) in ContentRepository.publish was added by #2460 and the method was removed by #2461, so the call is now undefined and the promoteRevision=false publish path crashes. Removing it is correct: migration 068 collapsed per-locale taxonomy rows into content_taxonomies keyed by translation group, and there are no remaining references to restampEntryPivot anywhere in the tree.
I compared the full publish method against the diff, verified no other restamp* symbols remain, re-read migration 068, and checked the changeset state. The code change is minimal and safe; existing MCP integration tests exercise this publish path.
One AGENTS.md convention item still needs attention: this PR changes a file in the published emdash package, and a changeset is required for published-package behavior changes. The author's unreleased-regression rationale is reasonable, but CONTRIBUTING.md only explicitly exempts docs/test/CI/tooling changes from changesets, and the release tooling tracks fixes via changeset files. A one-line patch changeset is the cleanest resolution.
The fix changes the published emdash package, and release notes are built from changeset files, so the crash fix needs an entry even though the crash itself never shipped in a release.
What does this PR do?
Publishing content on current
mainalways fails: the publish path throwsTypeError: this.restampEntryPivot is not a function. This is what turned Typecheck, Tests, and Integration Tests red on the release PR #2419. All failures in those three checks trace back to this one call.The cause: #2460 and #2461 merged on the same day and are incompatible, but they touch different lines, so the merge raised no conflict. #2460 added a
restampEntryPivotcall to the publish path inContentRepository. #2461 deleted that private method together with the pivot denormalization that it maintained, and removed every call that its branch contained. The new call from #2460 was not among them.The fix removes the leftover call. No replacement is needed: since migration 068 (#2461) the denormalized pivot columns are legacy. Taxonomy reads join the authoritative
ec_*row, and new pivot inserts leave those columns null.Existing tests already catch the regression: without the fix,
tests/integration/mcp/drafts.test.tsandtests/integration/mcp/search.test.tsfail with theTypeErrorabove, and six more files fail the same way in the Integration Tests CI job. With the fix they pass.Details
No changeset: the crash exists only on unreleased
main, so no published version ever contained it. The user-facing changes in this area are already covered by the changesets of #2460 and #2461.Type of change
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change)pnpm formathas been runtests/integration/mcp/already fail without the fix and pass with it)main; see Details)AI-generated code disclosure
Drafted and reviewed with Claude in separate sessions: Claude Fable 5 wrote the change, Claude Fable 5 verified it against the source in a fresh session.
Screenshots / test output
Red without the fix (current
main, 6602ae0):Green with the fix:
(
pnpm --filter emdash exec vitest run tests/integration/mcp/drafts.test.ts tests/integration/mcp/search.test.ts;pnpm typecheckpasses across all packages.)