Skip to content

fix(core): remove stale restampEntryPivot call that crashes content publish - #2466

Merged
khoinguyenpham04 merged 2 commits into
emdash-cms:mainfrom
danielmlr:fix/publish-restamp-leftover
Aug 14, 2026
Merged

fix(core): remove stale restampEntryPivot call that crashes content publish#2466
khoinguyenpham04 merged 2 commits into
emdash-cms:mainfrom
danielmlr:fix/publish-restamp-leftover

Conversation

@danielmlr

Copy link
Copy Markdown
Contributor

What does this PR do?

Publishing content on current main always fails: the publish path throws TypeError: 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 restampEntryPivot call to the publish path in ContentRepository. #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.ts and tests/integration/mcp/search.test.ts fail with the TypeError above, 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

  • Bug fix
  • Feature (requires maintainer-approved Discussion)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • I have read CONTRIBUTING.md
  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (n/a: the existing suites in tests/integration/mcp/ already fail without the fix and pass with it)
  • I have added a changeset (n/a: repairs an unreleased regression on main; see Details)
  • New features link to an approved Discussion: https://github.com/emdash-cms/emdash/discussions/...

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.

  • This PR includes AI-generated code — model/tool: Claude Fable 5 (draft and review, separate sessions)

Screenshots / test output

Red without the fix (current main, 6602ae0):

Content publish error: TypeError: this.restampEntryPivot is not a function
 Test Files  2 failed (2)
      Tests  4 failed | 23 passed (27)

Green with the fix:

 Test Files  2 passed (2)
      Tests  27 passed (27)

(pnpm --filter emdash exec vitest run tests/integration/mcp/drafts.test.ts tests/integration/mcp/search.test.ts; pnpm typecheck passes across all packages.)

…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-bot

changeset-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a7d92f3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
Name Type
emdash Patch
@emdash-cms/cloudflare Patch
@emdash-cms/sandbox-workerd Patch
@emdash-cms/plugin-mcp-smoke Patch
@emdash-cms/fixture-perf-site Patch
@emdash-cms/perf-demo-site Patch
@emdash-cms/cache-demo-site Patch
@emdash-cms/do-demo-site Patch
@emdash-cms/do-solo-demo-site Patch
@emdash-cms/admin Patch
@emdash-cms/auth Patch
@emdash-cms/blocks Patch
@emdash-cms/gutenberg-to-portable-text Patch
@emdash-cms/x402 Patch
create-emdash Patch
@emdash-cms/auth-atproto Patch
@emdash-cms/plugin-embeds Patch

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

@github-actions github-actions Bot added review/needs-review No maintainer or bot review yet area/core size/XS labels Aug 13, 2026
@pkg-pr-new

pkg-pr-new Bot commented Aug 13, 2026

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@2466

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@2466

@emdash-cms/auth-atproto

npm i https://pkg.pr.new/@emdash-cms/auth-atproto@2466

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@2466

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@2466

@emdash-cms/contentful-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/contentful-to-portable-text@2466

emdash

npm i https://pkg.pr.new/emdash@2466

create-emdash

npm i https://pkg.pr.new/create-emdash@2466

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@2466

@emdash-cms/plugin-cli

npm i https://pkg.pr.new/@emdash-cms/plugin-cli@2466

@emdash-cms/plugin-types

npm i https://pkg.pr.new/@emdash-cms/plugin-types@2466

@emdash-cms/registry-client

npm i https://pkg.pr.new/@emdash-cms/registry-client@2466

@emdash-cms/registry-lexicons

npm i https://pkg.pr.new/@emdash-cms/registry-lexicons@2466

@emdash-cms/registry-verification

npm i https://pkg.pr.new/@emdash-cms/registry-verification@2466

@emdash-cms/sandbox-workerd

npm i https://pkg.pr.new/@emdash-cms/sandbox-workerd@2466

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@2466

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@2466

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@2466

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@2466

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@2466

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@2466

@emdash-cms/plugin-field-kit

npm i https://pkg.pr.new/@emdash-cms/plugin-field-kit@2466

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@2466

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@2466

commit: a7d92f3

@emdashbot emdashbot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread packages/core/src/database/repositories/content.ts
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.
@github-actions github-actions Bot added review/needs-rereview Author pushed changes since the last review and removed review/needs-review No maintainer or bot review yet labels Aug 13, 2026

@khoinguyenpham04 khoinguyenpham04 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@khoinguyenpham04
khoinguyenpham04 merged commit 4e76317 into emdash-cms:main Aug 14, 2026
46 checks passed
@emdashbot emdashbot Bot mentioned this pull request Aug 14, 2026
@danielmlr
danielmlr deleted the fix/publish-restamp-leftover branch August 23, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core review/needs-rereview Author pushed changes since the last review size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants