Skip to content

[lexical-y] Chore: Point the known-failure tests at open issues - #9684

Merged
zurfyx merged 1 commit into
mainfrom
zurfyx/y-test-markers
Nov 1, 2026
Merged

zurfyx merged 1 commit into
mainfrom
zurfyx/y-test-markers

Conversation

@zurfyx

@zurfyx zurfyx commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Description

Two markers in @lexical/y's tests named nothing a reader could follow,
and one lane failed on a known gc-only case:

No behavior change; tests only.

Test plan

Before

$ LEXICAL_Y_GC=1 pnpm exec vitest run --project unit packages/lexical-y/src/__tests__/unit/regressions/Formats.test.ts -t F30A-1
 × italic over "b ", italic removed from "b"; the removal undone ‖ "b" italic again (ids 1,2,3)
 × italic over "b ", italic removed from "b"; the removal undone ‖ "b" italic again (ids 3,2,1)
 × italic over "b ", italic removed from "b"; the removal undone ‖ "b" italic again (ids 2,3,1)
AssertionError: expected '"a" "b"[I] " cd ef" / "next"' to be '"a" "b "[I] "cd ef" / "next"'
      Tests  3 failed | 8 passed | 187 skipped (198)

UndoRunEnds.test.ts with every test.fails turned into test: 81
failed, 98 passed, on gc off and gc on (each of the 81 is one of the two
issues' shapes; the issues carry standalone repros that fail on main).

After

$ pnpm exec vitest run --project unit packages/lexical-y/src/__tests__/unit/UndoRunEnds.test.ts packages/lexical-y/src/__tests__/unit/regressions/Formats.test.ts
      Tests  292 passed | 85 expected fail (377)
$ LEXICAL_Y_GC=1 pnpm exec vitest run --project unit packages/lexical-y/src/__tests__/unit/UndoRunEnds.test.ts packages/lexical-y/src/__tests__/unit/regressions/Formats.test.ts
      Tests  289 passed | 88 expected fail (377)

Whole @lexical/y unit project (vitest run --project unit packages/lexical-y/),
gc off and on (LEXICAL_Y_GC=1):

      Tests  1 failed | 18528 passed | 291 expected fail | 130 skipped (18950)
      Tests  18526 passed | 294 expected fail | 130 skipped (18950)

The one failure is DisposeMemory.test.ts (heap held above its 8 MB bound)
with 24 workers. It passes alone and 12 at a time, and the same full-suite
run fails it on main before #9679 (cfcd3c4, 9.4 MB): a heap bound that
full-suite load can exceed, unrelated to this change.

@vercel

vercel Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
lexical Ready Ready Preview Nov 1, 2026 1:38am UTC
lexical-playground Ready Ready Preview Nov 1, 2026 1:38am UTC

Request Review

@zurfyx
zurfyx requested a review from etrepum as a code owner November 1, 2026 01:07
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 1, 2026
@meta-code-review

meta-code-review Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 1, 2026, 1:47 AM UTC

@pkg-pr-new

pkg-pr-new Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
lexical

npm i https://pkg.pr.new/lexical@9684

@lexical/a11y

npm i https://pkg.pr.new/@lexical/a11y@9684

@lexical/clipboard

npm i https://pkg.pr.new/@lexical/clipboard@9684

@lexical/code

npm i https://pkg.pr.new/@lexical/code@9684

@lexical/code-core

npm i https://pkg.pr.new/@lexical/code-core@9684

@lexical/code-prism

npm i https://pkg.pr.new/@lexical/code-prism@9684

@lexical/code-shiki

npm i https://pkg.pr.new/@lexical/code-shiki@9684

@lexical/compiler

npm i https://pkg.pr.new/@lexical/compiler@9684

@lexical/devtools-core

npm i https://pkg.pr.new/@lexical/devtools-core@9684

@lexical/dragon

npm i https://pkg.pr.new/@lexical/dragon@9684

@lexical/eslint-plugin

npm i https://pkg.pr.new/@lexical/eslint-plugin@9684

@lexical/extension

npm i https://pkg.pr.new/@lexical/extension@9684

@lexical/fast-check

npm i https://pkg.pr.new/@lexical/fast-check@9684

@lexical/file

npm i https://pkg.pr.new/@lexical/file@9684

@lexical/hashtag

npm i https://pkg.pr.new/@lexical/hashtag@9684

@lexical/headless

npm i https://pkg.pr.new/@lexical/headless@9684

@lexical/history

npm i https://pkg.pr.new/@lexical/history@9684

@lexical/html

npm i https://pkg.pr.new/@lexical/html@9684

@lexical/internal

npm i https://pkg.pr.new/@lexical/internal@9684

@lexical/link

npm i https://pkg.pr.new/@lexical/link@9684

@lexical/list

npm i https://pkg.pr.new/@lexical/list@9684

@lexical/mark

npm i https://pkg.pr.new/@lexical/mark@9684

@lexical/markdown

npm i https://pkg.pr.new/@lexical/markdown@9684

@lexical/mdast

npm i https://pkg.pr.new/@lexical/mdast@9684

@lexical/offset

npm i https://pkg.pr.new/@lexical/offset@9684

@lexical/overflow

npm i https://pkg.pr.new/@lexical/overflow@9684

@lexical/plain-text

npm i https://pkg.pr.new/@lexical/plain-text@9684

@lexical/react

npm i https://pkg.pr.new/@lexical/react@9684

@lexical/rich-text

npm i https://pkg.pr.new/@lexical/rich-text@9684

@lexical/selection

npm i https://pkg.pr.new/@lexical/selection@9684

@lexical/table

npm i https://pkg.pr.new/@lexical/table@9684

@lexical/tailwind

npm i https://pkg.pr.new/@lexical/tailwind@9684

@lexical/text

npm i https://pkg.pr.new/@lexical/text@9684

@lexical/utils

npm i https://pkg.pr.new/@lexical/utils@9684

@lexical/y

npm i https://pkg.pr.new/@lexical/y@9684

@lexical/yjs

npm i https://pkg.pr.new/@lexical/yjs@9684

commit: be84cf8

@meta-code-review meta-code-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This looks good. Every known failure in @lexical/y's undo run-end tests now names an open issue instead of a parked draft, and the F30A-1 italic case is pinned to #9683 for the gc-on lane only, with the gc-off lane untouched.

The markers hold at this head. Each of the 81 cells marked in UndoRunEnds.test.ts still fails with the shape of the issue named above it, with and without LEXICAL_Y_GC=1:

  • #9681: a collaborator's text takes the undone run's value.
  • #9682: the value survives an undo past a restore the undo has seen.

The italic F30A-1 cells fail with gc on exactly as #9683 describes. As CONTRIBUTING.md says for tests, no changeset is needed.

Optional, non-blocking:

  • packages/lexical-y/AGENTS.md only requires a DECISIONS.md row update when a pull request changes a decision, and this one doesn't. Still, the new header cites D74 and D64, while those rows' Links cells (packages/lexical-y/DECISIONS.md:139 and :133) don't list #9681 or #9682 yet. The Open issues list in packages/lexical-website/docs/collaboration/y.md doesn't name #9681 or #9683 either. Adding them, here or in a follow-up, would let a reader get from the register to the tests and back.

@zurfyx

zurfyx commented Nov 1, 2026

Copy link
Copy Markdown
Member Author

Thanks. The D74/D64 links to #9681/#9682 and the y.md Open issues entries for #9681 and #9683 go into the docs PR #9685, so this one stays tests only.

zurfyx added a commit that referenced this pull request Nov 1, 2026
…ecisions on undo presses, list numbering, overlapping formats, rewritten words and provider ordering

## Description

Records four maintainer decisions of 10/31 in DECISIONS.md and y.md:

- **D81, accepted limit:** an undo press can show nothing when its step
  only restores or removes format items no reader shows; the next press
  undoes what the first was meant to. Every editor that uses Yjs's
  `UndoManager` behaves the same. Skipping such steps (#9630, closed)
  needed a per-press digest of what readers show. y.md: a sentence in
  Limits, Undo.
- **D90, accepted limit (#9632):** after four refused follow-ups in a row
  that the binding reads again, the author can show a derived list number
  from before them until its next edit. The stop on the fourth re-read is
  the backstop that ends reply loops (#9634, closed, showed the three
  requirements conflict). y.md: a Limits entry. The #9642 pins
  (`RefusedFollowUpRefresh`, `RefusedFollowUpFreshness`) now name D90 and
  the limit; they stay `test.fails`.
- **D91, accepted limit (#9626):** overlapping formats of one key from two
  writers can cancel, because a Yjs text keeps one format marker per key
  at a place (yjs/yjs#382); since #9601 this also reaches a link's edge
  and first word. #9601 is kept. y.md: Other races says why.
- **D93, accepted limit (#9610):** a comment on a word a collaborator
  rewrites at the same moment can land on the new word (`setTextContent`:
  one client id order; a block rewrite: one or both orders), the same race
  as text typed at the start of a range a collaborator formats. y.md: a
  sentence in Other races. New `regressions/CommentOnRewrittenWord.test.ts`
  pins the 9 cells where it happens as `test.fails` (12 block-rewrite cells
  and 2 `setTextContent` cells); #9610 stays open.
- **D92, decided (#9645):** providers deliver updates in causal order;
  a mesh or several relays need causal buffering. y.md: Servers states
  the requirement. #9645 stays open.

Also, from the review of #9684: D74 and D64 link #9681 and #9682, and
y.md's Open issues lists #9681 and #9683.

The agent-edit guidance is unchanged.

## Test plan

### Before

```
$ pnpm exec vitest run --project unit packages/lexical-y/src/__tests__/unit/regressions/RefusedFollowUpRefresh.test.ts packages/lexical-y/src/__tests__/unit/regressions/RefusedFollowUpFreshness.test.ts
      Tests  27 passed | 30 expected fail (57)
```

### After

```
$ pnpm exec prettier --check packages/lexical-y/DECISIONS.md packages/lexical-website/docs/collaboration/y.md packages/lexical-y/src/__tests__/unit/regressions/RefusedFollowUpRefresh.test.ts packages/lexical-y/src/__tests__/unit/regressions/RefusedFollowUpFreshness.test.ts
All matched files use Prettier code style!
$ pnpm exec vitest run --project unit packages/lexical-y/src/__tests__/unit/regressions/RefusedFollowUpRefresh.test.ts packages/lexical-y/src/__tests__/unit/regressions/RefusedFollowUpFreshness.test.ts
      Tests  27 passed | 30 expected fail (57)
$ pnpm exec vitest run --project unit packages/lexical-y/src/__tests__/unit/regressions/CommentOnRewrittenWord.test.ts
      Tests  5 passed | 9 expected fail (14)
$ LEXICAL_Y_GC=1 pnpm exec vitest run --project unit packages/lexical-y/src/__tests__/unit/regressions/CommentOnRewrittenWord.test.ts
      Tests  5 passed | 9 expected fail (14)
```

The two RefusedFollowUp files change only in comments; the same cells pass
and fail as on main. With every `test.fails` in CommentOnRewrittenWord
turned into `test`, exactly the 9 pinned cells fail (gc off and on).
zurfyx added a commit that referenced this pull request Nov 1, 2026
…ecisions on undo presses, list numbering, overlapping formats, rewritten words and provider ordering

## Description

Records five maintainer decisions of 10/31 in DECISIONS.md and y.md:

- **D81, accepted limit:** an undo press can show nothing when its step
  only restores or removes format items no reader shows, and several such
  steps take several presses, as with Yjs's `UndoManager` in any editor
  that uses it as it is. Skipping such steps (#9630, closed)
  needed a per-press digest of what readers show. y.md: a sentence in
  Limits, Undo.
- **D90, accepted limit (#9632):** after four refused follow-ups in a row
  that the binding reads again, the author can show a derived list number
  from before them until that list is refreshed (an edit elsewhere does
  not do it); its fresh read, other clients and a reload are right. The stop on the fourth re-read is
  the backstop that ends reply loops (#9634, closed, showed the three
  requirements conflict). y.md: a Limits entry. The #9642 pins
  (`RefusedFollowUpRefresh`, `RefusedFollowUpFreshness`) now name D90 and
  the limit; they stay `test.fails`.
- **D91, accepted limit (#9626):** overlapping formats of one key from two
  writers can cancel, because a Yjs text gives each place one value per
  key (yjs/yjs#382); since #9601 this also reaches a link's edge
  and first word. #9601 is kept. y.md: Other races says why.
- **D93, accepted limit (#9610):** a comment on a word a collaborator
  rewrites at the same moment can land on the new word (`setTextContent`:
  one client id order; a block rewrite: one or both orders), the same race
  as text typed at the start of a range a collaborator formats. y.md: a
  sentence in Other races. New `regressions/CommentOnRewrittenWord.test.ts`
  pins the 9 cells where it happens as `test.fails` (12 block-rewrite cells
  and 2 `setTextContent` cells); #9610 stays open. D77 (the open question)
  says D93 replaced it.
- **D92, decided (#9645):** providers deliver updates in causal order;
  a single relay that forwards each client's updates in the order it
  received them does; a mesh or several relays need causal buffering that
  tracks dependencies, deletions included. y.md: Servers states
  the requirement. #9645 stays open.

Also, from the review of #9684: D74 and D64 link #9681 and #9682, and
y.md's Open issues lists #9681 and #9683.

The agent-edit guidance is unchanged.

## Test plan

### Before

```
$ pnpm exec vitest run --project unit packages/lexical-y/src/__tests__/unit/regressions/RefusedFollowUpRefresh.test.ts packages/lexical-y/src/__tests__/unit/regressions/RefusedFollowUpFreshness.test.ts
      Tests  27 passed | 30 expected fail (57)
```

### After

```
$ pnpm exec prettier --check packages/lexical-y/DECISIONS.md packages/lexical-website/docs/collaboration/y.md packages/lexical-y/src/__tests__/unit/regressions/RefusedFollowUpRefresh.test.ts packages/lexical-y/src/__tests__/unit/regressions/RefusedFollowUpFreshness.test.ts
All matched files use Prettier code style!
$ pnpm exec vitest run --project unit packages/lexical-y/src/__tests__/unit/regressions/RefusedFollowUpRefresh.test.ts packages/lexical-y/src/__tests__/unit/regressions/RefusedFollowUpFreshness.test.ts
      Tests  27 passed | 30 expected fail (57)
$ pnpm exec vitest run --project unit packages/lexical-y/src/__tests__/unit/regressions/CommentOnRewrittenWord.test.ts
      Tests  5 passed | 9 expected fail (14)
$ LEXICAL_Y_GC=1 pnpm exec vitest run --project unit packages/lexical-y/src/__tests__/unit/regressions/CommentOnRewrittenWord.test.ts
      Tests  5 passed | 9 expected fail (14)
```

The two RefusedFollowUp files change only in comments; the same cells pass
and fail as on main. With every `test.fails` in CommentOnRewrittenWord
turned into `test`, exactly the 9 pinned cells fail (gc off and on).
## Description

Two markers in `@lexical/y`'s tests named nothing a reader could follow,
and one lane failed on a known gc-only case:

- `UndoRunEnds.test.ts`: its 14 `test.fails` groups (81 cells) named only
  #9561, a pull request parked as a draft. Each now names the open issue
  that tracks it: #9681 (an undo of text typed inside a run deletes that
  text's run ends, so a collaborator's plain text next to it takes the
  run's value; D74) or #9682 (an undo of a run's value leaves it after a
  restore the undo has seen; D64, documented in y.md's Limits, Undo). The
  file's header says so and that #9561 fixes both.
- `regressions/Formats.test.ts`, F30A-1: the italic case fails with gc on
  (`LEXICAL_Y_GC=1`, which #9679 added), for 3 client id orders, the same
  on main before #9679. It is now a `test.fails` naming #9683 with gc on
  only, so the gc-on lane is green.
- `regressions/PasteRemadeLine.test.ts` names #9587, which GitHub had
  closed by mistake (#9598's "Not fixed: #9587" reads as a closing
  keyword); the repro still fails on main, and the issue is reopened. No
  change to the test.

No behavior change; tests only.

## Test plan

### Before

```
$ LEXICAL_Y_GC=1 pnpm exec vitest run --project unit packages/lexical-y/src/__tests__/unit/regressions/Formats.test.ts -t F30A-1
 × italic over "b ", italic removed from "b"; the removal undone ‖ "b" italic again (ids 1,2,3)
 × italic over "b ", italic removed from "b"; the removal undone ‖ "b" italic again (ids 3,2,1)
 × italic over "b ", italic removed from "b"; the removal undone ‖ "b" italic again (ids 2,3,1)
AssertionError: expected '"a" "b"[I] " cd ef" / "next"' to be '"a" "b "[I] "cd ef" / "next"'
      Tests  3 failed | 8 passed | 187 skipped (198)
```

`UndoRunEnds.test.ts` with every `test.fails` turned into `test`: 81
failed, 98 passed, on gc off and gc on (each of the 81 is one of the two
issues' shapes; the issues carry standalone repros that fail on main).

### After

```
$ pnpm exec vitest run --project unit packages/lexical-y/src/__tests__/unit/UndoRunEnds.test.ts packages/lexical-y/src/__tests__/unit/regressions/Formats.test.ts
      Tests  292 passed | 85 expected fail (377)
$ LEXICAL_Y_GC=1 pnpm exec vitest run --project unit packages/lexical-y/src/__tests__/unit/UndoRunEnds.test.ts packages/lexical-y/src/__tests__/unit/regressions/Formats.test.ts
      Tests  289 passed | 88 expected fail (377)
```

Whole `@lexical/y` unit project (`vitest run --project unit packages/lexical-y/`),
gc off and on (`LEXICAL_Y_GC=1`):

```
      Tests  1 failed | 18528 passed | 291 expected fail | 130 skipped (18950)
      Tests  18526 passed | 294 expected fail | 130 skipped (18950)
```

The one failure is `DisposeMemory.test.ts` (heap held above its 8 MB bound)
with 24 workers. It passes alone and 12 at a time, and the same full-suite
run fails it on main before #9679 (cfcd3c4, 9.4 MB): a heap bound that
full-suite load can exceed, unrelated to this change.

@meta-code-review meta-code-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good: every marker now names an open issue that matches the failure it pins, and the change stays test-only.

With the markers removed, the same 81 cells in UndoRunEnds.test.ts fail with garbage collection off and with it on, each group on one assertion. Each group fails the way the issue it names describes: for #9681, E's plain text takes the run's value after F's undo; for #9682, A's undo leaves the bold after F's restore. The three F30A-1 italic cells fail only with LEXICAL_Y_GC=1, as #9683 says.

Optional, non-blocking:

  • packages/lexical-y/src/__tests__/unit/regressions/Formats.test.ts:912: the unit job in .github/workflows/call-core-tests.yml does not set LEXICAL_Y_GC, so CI only runs this case with gc off and will not flag the test.fails once #9683 is fixed. A note in #9683 that the fix needs a LEXICAL_Y_GC=1 run to drop the marker would keep it from going stale.
  • The Test plan describes the Before run of UndoRunEnds.test.ts (81 failed, 98 passed with every test.fails turned into test) instead of pasting its output, which AGENTS.md ("Commits and Pull Requests") asks for. The numbers reproduce, so this only matters for the record.

No changeset is needed: CONTRIBUTING.md ("Changesets") exempts test-only changes.

];
for (const [name, $first, $second, $again, expected] of cases) {
// #9683: with gc on, the italic case takes the italic off the space.
const knownGcFailure = WITH_GC && name.startsWith('italic');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Optional, non-blocking: the unit job in .github/workflows/call-core-tests.yml does not set LEXICAL_Y_GC, so CI only runs this case with gc off and will not flag this test.fails once #9683 is fixed. A note in #9683 that the fix needs a LEXICAL_Y_GC=1 run to drop the marker would keep it from going stale.

zurfyx added a commit that referenced this pull request Nov 1, 2026
…ecisions on undo presses, list numbering, overlapping formats, rewritten words and provider ordering

## Description

Records five maintainer decisions of 10/31 in DECISIONS.md and y.md:

- **D81, accepted limit:** an undo press can show nothing when its step
  only restores or removes format items no reader shows, and several such
  steps take several presses, as with Yjs's `UndoManager` in any editor
  that uses it as it is. Skipping such steps (#9630, closed)
  needed a per-press digest of what readers show. y.md: a sentence in
  Limits, Undo.
- **D90, accepted limit (#9632):** after four refused follow-ups in a row
  that the binding reads again, the author can show a derived list number
  from before them until that list is refreshed (adding an item does; an
  edit elsewhere or retyping an item does not); its fresh read, other
  clients and a reload are right. The stop on the fourth re-read is
  the backstop that ends reply loops (#9634, closed, showed the three
  requirements conflict). y.md: a Limits entry. The #9642 pins
  (`RefusedFollowUpRefresh`, `RefusedFollowUpFreshness`) now name D90 and
  the limit; they stay `test.fails`.
- **D91, accepted limit (#9626):** overlapping formats of one key from two
  writers can cancel, because a Yjs text gives each place one value per
  key (yjs/yjs#382); since #9601 this also reaches a link's edge
  and first word. #9601 is kept. y.md: Other races says why.
- **D93, accepted limit (#9610):** a comment on a word a collaborator
  rewrites at the same moment can land on the new word (`setTextContent`:
  one client id order; a block rewrite: one or both orders), the same race
  as text typed at the start of a range a collaborator formats. y.md: a
  sentence in Other races. New `regressions/CommentOnRewrittenWord.test.ts`
  pins the 9 cells where it happens as `test.fails` (12 block-rewrite cells
  and 2 `setTextContent` cells); #9610 stays open. D77 (the open question)
  says D93 replaced it.
- **D92, decided (#9645):** providers deliver updates in causal order;
  a single relay that forwards every update to each client in the one
  order it received them does; a mesh or several relays need causal buffering that
  tracks dependencies, deletions included. y.md: Servers states
  the requirement. #9645 stays open.

Also, from the review of #9684: D74 and D64 link #9681 and #9682, and
y.md's Open issues lists #9681 and #9683.

The agent-edit guidance is unchanged.

## Test plan

### Before

```
$ pnpm exec vitest run --project unit packages/lexical-y/src/__tests__/unit/regressions/RefusedFollowUpRefresh.test.ts packages/lexical-y/src/__tests__/unit/regressions/RefusedFollowUpFreshness.test.ts
      Tests  27 passed | 30 expected fail (57)
```

### After

```
$ pnpm exec prettier --check packages/lexical-y/DECISIONS.md packages/lexical-website/docs/collaboration/y.md packages/lexical-y/src/__tests__/unit/regressions/RefusedFollowUpRefresh.test.ts packages/lexical-y/src/__tests__/unit/regressions/RefusedFollowUpFreshness.test.ts
All matched files use Prettier code style!
$ pnpm exec vitest run --project unit packages/lexical-y/src/__tests__/unit/regressions/RefusedFollowUpRefresh.test.ts packages/lexical-y/src/__tests__/unit/regressions/RefusedFollowUpFreshness.test.ts
      Tests  27 passed | 30 expected fail (57)
$ pnpm exec vitest run --project unit packages/lexical-y/src/__tests__/unit/regressions/CommentOnRewrittenWord.test.ts
      Tests  5 passed | 9 expected fail (14)
$ LEXICAL_Y_GC=1 pnpm exec vitest run --project unit packages/lexical-y/src/__tests__/unit/regressions/CommentOnRewrittenWord.test.ts
      Tests  5 passed | 9 expected fail (14)
```

The two RefusedFollowUp files change only in comments; the same cells pass
and fail as on main. With every `test.fails` in CommentOnRewrittenWord
turned into `test`, exactly the 9 pinned cells fail (gc off and on).
@zurfyx
zurfyx added this pull request to the merge queue Nov 1, 2026
Merged via the queue into main with commit 55e7bfc Nov 1, 2026
57 checks passed
zurfyx added a commit that referenced this pull request Nov 1, 2026
…9694 (an editor stopped matching its own document in long sessions)

Reverts #9679 whole, on top of current `main` (keeps #9684 and #9685).

With #9679, a downstream app's long-note sessions end with an editor that
no longer matches its own Yjs document (15 of 133 sessions; 0 of 132 on
the commit before #9679). Reverting only part of it does not work: the
delete rule (D86) alone is worse on a recorded session (2810), and the
divergence was traced to one of its hunks (the end a restated run gets at a range's end, which could be linked into another container; #9693 fixes that at the source). This PR is the fallback if #9693 is not taken. Closes #9694 if merged instead of #9693.

What this brings back, as before #9679:

- A delete collapses the run of deleted content and format items it
  leaves to a bounded number per format key (D24's bound): the cases it
  fixed (#9575, #9609, a #9620 cell, #9640's concurrent restore cells) fail
  again and are pinned with their issues.
- No format items kept from garbage collection: with gc on, an undo can
  again put a value back past its end (#9623). The harness keeps its
  `LEXICAL_Y_GC` switch (added by #9679), and the cells that fail only with
  gc on are pinned as `test.fails` with gc on, naming #9623.
- The restore rules for #9671 and the restore scan for #9599 (D78) are
  gone: those cases are open again.

`DECISIONS.md` keeps D86 and D88 (now `REVERTED`, with the reason) and
reopens D78, rather than rewriting them. `y.md` goes back to the behavior
before #9679. The two changesets of #9679 are removed: it was not part of
a release, so there is nothing to announce.

`UndoSpreadSession2810.test.ts` (added by #9679) is kept: it passes without
D86 and D88 as well.

`main` 60022ae: the downstream app's long-note sessions diverge in
15 of 133.

```
$ LEXICAL_Y_GC=0 vitest --run --project unit
 Test Files  1 failed | 648 passed | 4 skipped (653)
      Tests  1 failed | 28071 passed | 481 expected fail | 135 skipped (28688)
$ LEXICAL_Y_GC=1 vitest --run --project unit
 Test Files  2 failed | 647 passed | 4 skipped (653)
      Tests  2 failed | 28055 passed | 496 expected fail | 135 skipped (28688)
$ pnpm run ci-check
exit 0
```

The failures are load flakes with 40 workers: `DisposeMemory.test.ts` (heap
bound; gc off and on) and `MarkdownEscaping.test.ts` (5 s timeout, gc on).
Each passes alone (two runs each).

This branch was successfully deployed

2 active deployments
Preview – lexical — be84cf89 Deployed Nov 1, 2026 by vercel[bot]
Preview – lexical-playground — be84cf89 Deployed Nov 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

1 participant