Skip to content

fix(activity-feed-v2): dedupe prosemirror-model to fix mention selection#4680

Merged
mergify[bot] merged 1 commit into
box:masterfrom
jackiejou:fix/dedupe-prosemirror-mention-selection
Jul 8, 2026
Merged

fix(activity-feed-v2): dedupe prosemirror-model to fix mention selection#4680
mergify[bot] merged 1 commit into
box:masterfrom
jackiejou:fix/dedupe-prosemirror-mention-selection

Conversation

@jackiejou

Copy link
Copy Markdown
Contributor

Summary

  • Selecting a user from the @mention dropdown in the v2 activity feed editor silently failed with RangeError: Can not convert <mention, " "> to a Fragment (looks like multiple versions of prosemirror-model were loaded), so the mention was never inserted.
  • Root cause: feat(activity-feed-v2): add highlight state to comments #4672 bumped @box/threaded-annotations to 3.x (tiptap 3). @tiptap/pm requires prosemirror-model@^1.25.7, but yarn.lock kept a stale prosemirror-model@1.25.4 entry that prosemirror-state/prosemirror-view/prosemirror-tables still resolved to, so two copies of prosemirror-model (and prosemirror-view) were installed. The editor schema and the transaction pipeline used different copies, breaking the instanceof checks during mention insertion.
  • Fix: dedupe prosemirror-model (single 1.25.9) and prosemirror-view (single 1.42.0) in yarn.lock. All existing semver ranges are satisfied by the deduped versions; no package.json changes.

Test plan

  • Verified before/after with a jsdom test driving the real @box/activity-feed editor: typing @Ali opens the dropdown in both cases; selecting a user threw the RangeError before this change and correctly inserts the mention node after.
  • yarn install produces a single prosemirror-model/prosemirror-view copy (no nested copy under @tiptap/pm/node_modules).
  • Full src/elements/content-sidebar/activity-feed-v2 jest suite passes (342 tests).
  • Manual smoke test: mention a user in the v2 activity feed comment editor and post.

The threaded-annotations 3.x bump (tiptap 3) left a stale
prosemirror-model 1.25.4 entry in yarn.lock while @tiptap/pm required
^1.25.7, so two copies were installed and selecting a mention user threw
"RangeError: Can not convert <mention, ' '> to a Fragment". Dedupe
prosemirror-model/-view to a single version so only one copy is loaded.
@jackiejou
jackiejou requested a review from a team as a code owner July 8, 2026 19:10
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3e082977-07f9-49a3-b5ee-31911b676d49

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

@mergify

mergify Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-07-08 19:21 UTC · Rule: Automatic strict merge · triggered by rule Automatic merge queue
  • Checks skipped · PR is already up-to-date
  • Merged2026-07-08 19:21 UTC · at 4439fe5ea55acd7b6278e86b733ec3a4af6864cb · squash

This pull request spent 10 seconds in the queue, including 1 second running CI.

Required conditions to merge
  • github-review-approved [🛡 GitHub branch protection]
  • github-review-decision = APPROVED [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Summary
    • check-neutral = Summary
    • check-skipped = Summary
  • any of [🛡 GitHub branch protection]:
    • check-success = lint_test_build
    • check-neutral = lint_test_build
    • check-skipped = lint_test_build
  • any of [🛡 GitHub branch protection]:
    • check-success = license/cla
    • check-neutral = license/cla
    • check-skipped = license/cla
  • any of [🛡 GitHub branch protection]:
    • check-success = lint_pull_request
    • check-neutral = lint_pull_request
    • check-skipped = lint_pull_request

@mergify
mergify Bot merged commit 81ddb31 into box:master Jul 8, 2026
9 of 10 checks passed
@mergify mergify Bot removed the queued label Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants