feat(nbstore): rename SyncStorage to DocSyncStorage (#10751)

This commit is contained in:
EYHN
2025-03-14 06:25:26 +00:00
parent 92effd9b51
commit f3ef9c4415
19 changed files with 90 additions and 79 deletions

View File

@@ -1,5 +1,8 @@
import { IndexedDBDocStorage, IndexedDBSyncStorage } from '@affine/nbstore/idb';
import { SqliteDocStorage, SqliteSyncStorage } from '@affine/nbstore/sqlite';
import {
IndexedDBDocStorage,
IndexedDBDocSyncStorage,
} from '@affine/nbstore/idb';
import { SqliteDocStorage, SqliteDocSyncStorage } from '@affine/nbstore/sqlite';
import type { StoreClient } from '@affine/nbstore/worker/client';
import { Entity } from '@toeverything/infra';
@@ -16,10 +19,10 @@ export class UserDBEngine extends Entity<{
BUILD_CONFIG.isElectron || BUILD_CONFIG.isIOS
? SqliteDocStorage
: IndexedDBDocStorage;
SyncStorageType =
DocSyncStorageType =
BUILD_CONFIG.isElectron || BUILD_CONFIG.isIOS
? SqliteSyncStorage
: IndexedDBSyncStorage;
? SqliteDocSyncStorage
: IndexedDBDocSyncStorage;
canGracefulStop() {
// TODO(@eyhn): Implement this
@@ -44,8 +47,8 @@ export class UserDBEngine extends Entity<{
type: 'userspace',
},
},
sync: {
name: this.SyncStorageType.identifier,
docSync: {
name: this.DocSyncStorageType.identifier,
opts: {
id: `${serverService.server.id}:` + this.userId,
type: 'userspace',