Skip to content

test: fail when the email editor would load two copies of a ProseMirror core package - #515

Merged
KMKoushik merged 1 commit into
mainfrom
hq/editor-single-prosemirror
Nov 16, 2026
Merged

KMKoushik merged 1 commit into
mainfrom
hq/editor-single-prosemirror

Conversation

@KMKoushik

@KMKoushik KMKoushik commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

The bug: from Oct 26 to Nov 16 2026, typing in the email editor did nothing. Keys moved the cursor, but no text was added or deleted, and nothing was saved. A customer reported it through in-app feedback on Nov 3.

Cause: #470 overrode prosemirror-view to 1.42.6 for an advisory. Its copy of prosemirror-model (1.25.12) differed from the one @tiptap/pm 2.27.2 used (1.25.10), so the bundle shipped two copies.

  • ProseMirror's view and model must be the same copy. Otherwise each DOM change fails with "Can not convert <…> to a Fragment (looks like multiple versions of prosemirror-model were loaded)" and is discarded.

Already fixed in production by #513, which moved Tiptap to 2.27.3. That unified everything on prosemirror-model 1.25.12.

Verified in Chromium with the real @usesend/email-editor component, built from apps/web's dependencies. Typing " world" after "Hello", then Backspace twice:

text onUpdate calls console
before (4f89d86) Hello 0 "multiple versions of prosemirror-model were loaded"
after (74c195d) Hello wor 8 clean

The production Next build from the new lockfile contains one copy of prosemirror-model.

This PR adds a unit test that fails if the lockfile ever installs more than one version of prosemirror-model, -state, -transform or -view. So a future override or upgrade can't silently break the editor again.

  • It fails on the old lockfile, flagging prosemirror-model, and passes on main.

Verified: typecheck; unit 348; pnpm build:editor && pnpm build:web (29/29).

Note: the self-hosted images v1.10.0–v1.10.3 all contain the broken lockfile, so self-hosters need a new release.

Ask Polylane for an impact assessment of this pull request:

Assess with Polylane


Summary by cubic

Adds a regression test that fails if the lockfile ever resolves more than one version of a ProseMirror core package.

Duplicate copies of prosemirror-model silently broke typing in the email editor from Oct 26 to Nov 16 2026: the cursor moved but no text was added or saved. The fix shipped in #513; this test guards prosemirror-model, prosemirror-state, prosemirror-transform, and prosemirror-view so a future override or upgrade fails the build instead of regressing the editor.

Rollout

  • Self-hosted images v1.10.0–v1.10.3 contain the broken lockfile and need a new release.

Written for commit c877a81. Summary will update on new commits.

View guided diff Turn on auto-fix

Summary by CodeRabbit

  • Tests
    • Added an automated check that verifies the lockfile contains exactly one version of each of four ProseMirror packages.
    • The check helps flag inconsistent package versions during testing.

@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
unsend-marketing Ready Ready Preview Nov 16, 2026 12:36am UTC

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds a Vitest test that reads pnpm-lock.yaml and checks that prosemirror-model, prosemirror-state, prosemirror-transform, and prosemirror-view each have exactly one matching package version. A comment describes a prior duplicate-ProseMirror issue and suggests aligning versions if the test fails.

Change: Other

Merge Risk: Minimal · up to c877a

This change adds a test that guards against duplicate ProseMirror core packages in the lockfile. It does not alter runtime behavior, and no actionable merge risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: a new unit test that fails when the lockfile would install two copies of a ProseMirror core package (model, state, transform, or view). The raw summary confirms the ad…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: a new unit test that fails when the lockfile would install two copies of a ProseMirror core package (model, state, transform, or view). The raw summary confirms the added test checks exactly one version per package. The title is specific and matches the changeset, so it passes.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

apps/web/src/editor-dependencies.unit.test.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c32cff29-dead-490c-b865-d38a81112bda
Commits

Reviewing files that changed from the base of the PR and between 74c195d and c877a81.

Files selected for processing: 1

  • apps/web/src/editor-dependencies.unit.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying usesend with  Cloudflare Pages  Cloudflare Pages

Latest commit: c877a81
Status: ✅  Deploy successful!
Preview URL: https://ef0abbb8.usesend.pages.dev
Branch Preview URL: https://hq-editor-single-prosemirror.usesend.pages.dev

View logs

@KMKoushik
KMKoushik merged commit 9ae9a23 into main Nov 16, 2026
7 checks passed
@KMKoushik
KMKoushik deleted the hq/editor-single-prosemirror branch November 16, 2026 00:40

This branch was successfully deployed

1 active deployment
Preview — c877a81e Deployed Nov 16, 2026 by vercel[bot]
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