dream-num / univer

Univer is an open-source alternative to Google Sheets, Slides, and Docs
https://univer.ai
Apache License 2.0
5.68k stars 469 forks source link

[Bug] Calling DocumentDataModel.reset(snapshot: Partial<IDocumentData>) does not rerender visually #2636

Open LeosPrograms opened 4 days ago

LeosPrograms commented 4 days ago

Before you submit this issue, have you checked the following

Affected packages and versions

0.1.17

Reproduction

  1. generate a document using document1 = univer.createUnit(UniverInstanceType.UNIVER_DOC, {});
  2. generate a second document using document2 = univer.createUnit(UniverInstanceType.UNIVER_DOC, {});
  3. make changes to document2
  4. apply changes from document2 to document1 using document1.reset(document2.snapshot)

Expected behavior

The browser displaying document1 should reflect the data that is included in the snapshot passed to reset()

Actual behavior

The document does not change visually. Once changes are applied via manual typing, both those changes, and the changes passed to reset() are suddenly applied.

System information

Running in electron on Ubuntu 22.04.4