AFFiNE/packages/frontend
Peng Xiao 16488d594c
fix(infra): compatibility fix for space prefix (#4912)
It seems there are some cases that [this upstream PR](https://github.com/toeverything/blocksuite/pull/4747) will cause data loss.

Because of some historical reasons, the page id could be different with its doc id.
It might be caused by subdoc migration in the following (not 100% sure if all white screen issue is caused by it) 0714c12703/packages/common/infra/src/blocksuite/index.ts (L538-L540)

In version 0.10, page id in spaces no longer has prefix "space:"
The data flow for fetching a doc's updates is:
- page id in `meta.pages` -> find `${page-id}` in `doc.spaces` -> `doc` -> `doc.guid`
if `doc` is not found in `doc.spaces`, a new doc will be created and its `doc.guid` is the same with its pageId
- because of guid logic change, the doc that previously prefixed with `space:` will not be found in `doc.spaces`
- when fetching the rows of this doc using the doc id === page id,
  it will return EMPTY since there is no updates associated with the page id

The provided fix in the PR will patch the `spaces` field of the root doc so that after 0.10 the page doc can still be found in the `spaces` map. It shall apply to both of the idb & sqlite datasources.

Special thanks to @lawvs 's db file for investigation!
2023-11-14 14:39:50 +08:00
..
component fix(storybook): page tags display (#4924) 2023-11-14 09:45:12 +08:00
core ci(core): eslint errors for core (#4662) 2023-11-10 10:25:59 +00:00
electron fix(infra): compatibility fix for space prefix (#4912) 2023-11-14 14:39:50 +08:00
graphql ci(core): eslint errors for core (#4662) 2023-11-10 10:25:59 +00:00
hooks fix(infra): compatibility fix for space prefix (#4912) 2023-11-14 14:39:50 +08:00
i18n v0.10.0 2023-11-10 11:42:04 +08:00
native v0.10.0 2023-11-10 11:42:04 +08:00
templates v0.10.0 2023-11-10 11:42:04 +08:00
workspace fix(core): svg blob syncing issue (#4886) 2023-11-10 05:32:51 +00:00