Commit Graph

16 Commits

Author SHA1 Message Date
Peng Xiao 890e3e4435 fix(core): should not refetch avatar when url does not change (#5070)
blob resources are in fact immutable. We do not need to refetch it by swr policies (mount/visibilitychange/etc)
2023-11-28 08:01:19 +00:00
Joooye_34 4c8d54b3a7 refactor(core): use manual upgrade to replace auto migration when web setup (#5022)
1. Split logic in `packages/common/infra/src/blocksuite/index.ts` to multiple single files
2. Move migration logic from setup to upgrade module, to prevent auto migration problems and loading problem
2023-11-23 02:26:06 +00:00
Flrande 8b2c3d4c41 chore: bump blocksuite (#4958) 2023-11-16 22:01:03 +08:00
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) https://github.com/toeverything/AFFiNE/blob/0714c12703ff8840acc180633e5489c755ddfba3/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
Whitewater eded501123 fix: get page preview based on block order (#4888)
Co-authored-by: Peng Xiao <pengxiao@outlook.com>
2023-11-12 15:09:57 +00:00
Joooye_34 30bac7dce2 ci(core): eslint errors for core (#4662) 2023-11-10 10:25:59 +00:00
Peng Xiao fd74776abe fix(core): disable sync doc/blob on start (#4897) 2023-11-09 18:00:53 +00:00
liuyi f9654bb1f8 feat(core): unify all new created page IDs to nanoid (#4884) 2023-11-09 09:22:02 +00:00
EYHN e3e0553c56 fix(hooks): missing page preview and references (#4863) 2023-11-09 08:59:36 +00:00
Hongtao Lye 12c72e63b1 chore: bump blocksuite version (#4862) 2023-11-08 07:12:48 +00:00
JimmFly 9664d142ad feat(core): temporary expansion files are limited to 100M (#4833) 2023-11-06 06:38:46 +00:00
Peng Xiao 7e381e830a perf(core): load all pages after 10s (#4834) 2023-11-03 09:42:29 +00:00
Peng Xiao f08408ebe5 fix(core): possible crash issues (#4783) 2023-10-31 08:56:14 +00:00
3720 ef8024c657 feat: new collections (#4530)
Co-authored-by: Peng Xiao <pengxiao@outlook.com>
2023-10-27 09:06:59 +00:00
Alex Yang 9958baa843 fix(hooks): use uuid as pageId (#4658) 2023-10-18 22:14:41 -05:00
Joooye_34 bed9310519 refactor(infra): directory structure (#4615) 2023-10-18 15:30:08 +00:00