Skip to content

V2 can lose a typed suffix during a render failure; save resolves without recovering it #4007

Description

@jfurneaux

SuperDoc 2.14.0 / @superdoc/react 2.9.0 / @superdoc/sdk 2.11.0. Standalone React page, Hocuspocus collaboration, synthetic Word agreement with a resolved suggestion and a comment. No application autosave runs.

Typing Donor: {{DONOR_NAME}} into an initially focused, editable composition input can leave only Donor: in the shared document. All 22 printable keydown events reach the focused, non-readonly input. After removing CPU throttling and awaiting superdoc.save(), the placeholder remains absent in both other joined browsers.

Reproduction sequence:

  1. Seed a fresh V2 Hocuspocus room from a synthetic reviewed DOCX. Append a final paragraph: A later edit requires another review.
  2. Join an author, an editor and a viewer in three browser contexts. Await readiness. Save the author once before opening the other contexts; no save runs during typing.
  3. Apply Chrome Emulation.setCPUThrottlingRate({ rate: 32 }) to the author context only.
  4. Click the rendered final paragraph, press End, verify the composition input is focused, editable and data-v2-ime-host-parked="false", then use Playwright pressSequentially(' Donor: {{DONOR_NAME}}') with its default typing cadence.
  5. Check full text in all three browsers. The editing view reports diagnosticCode: PERFORMANCE_ERROR, diagnosticStage: render, then blanks. Both joined browsers contain only the donor prefix.
  6. Remove throttling, await the author's superdoc.save(), and inspect both joined browsers again. Save resolves; the placeholder remains absent.

Results: three ordinary controls and three 8x CPU controls preserve all text. Three 32x controls truncate it. Two fresh 32x controls additionally confirm truncation after removing throttling and awaiting save. Input parking by itself is not sufficient: the successful 8x controls also include key events while parked.

Additional fault-injection controls delayed delivery of worker response events while preserving order: at 150 ms, two editing views blank but joined browsers retain full text; at 500 ms, two cases lose the placeholder even after save. These latency controls are separate diagnostics, not required for the CPU reproduction.

Could you investigate the V2 input/commit handling during render failure and advise on a supported fix that retains typed characters? I have the synthetic DOCX, event captures and standalone scripts available.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

status: ready-for-validationAll blockers are done or in pre-release; ready for validation, not necessarily generally released.

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions