test: fail when the email editor would load two copies of a ProseMirror core package
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:
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.
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.