mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-15 00:56:26 +08:00
fix: client indexing & outdated scheme (#14160)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Optimized storage handling with platform-specific
implementations—SQLite for Electron and IndexedDB for other environments
for improved performance.
* **Bug Fixes**
* Enhanced recording file access and retrieval functionality for better
reliability.
* Strengthened local file protocol handling and security restrictions.
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -6,7 +6,6 @@ import queryString from 'query-string';
|
||||
|
||||
function maybeAffineOrigin(origin: string, baseUrl: string) {
|
||||
return (
|
||||
origin.startsWith('file://') ||
|
||||
origin.startsWith('assets://') ||
|
||||
origin.endsWith('affine.pro') || // stable/beta
|
||||
origin.endsWith('apple.getaffineapp.com') || // stable/beta
|
||||
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
IndexedDBBlobSyncStorage,
|
||||
IndexedDBDocStorage,
|
||||
IndexedDBDocSyncStorage,
|
||||
IndexedDBIndexerStorage,
|
||||
} from '@affine/nbstore/idb';
|
||||
import {
|
||||
IndexedDBV1BlobStorage,
|
||||
@@ -29,6 +30,7 @@ import {
|
||||
SqliteBlobSyncStorage,
|
||||
SqliteDocStorage,
|
||||
SqliteDocSyncStorage,
|
||||
SqliteIndexerStorage,
|
||||
} from '@affine/nbstore/sqlite';
|
||||
import {
|
||||
SqliteV1BlobStorage,
|
||||
@@ -130,6 +132,9 @@ class CloudWorkspaceFlavourProvider implements WorkspaceFlavourProvider {
|
||||
BUILD_CONFIG.isElectron || BUILD_CONFIG.isIOS || BUILD_CONFIG.isAndroid
|
||||
? SqliteBlobSyncStorage
|
||||
: IndexedDBBlobSyncStorage;
|
||||
IndexerStorageType = BUILD_CONFIG.isElectron
|
||||
? SqliteIndexerStorage
|
||||
: IndexedDBIndexerStorage;
|
||||
|
||||
async deleteWorkspace(id: string): Promise<void> {
|
||||
await this.graphqlService.gql({
|
||||
@@ -481,7 +486,7 @@ class CloudWorkspaceFlavourProvider implements WorkspaceFlavourProvider {
|
||||
},
|
||||
},
|
||||
indexer: {
|
||||
name: 'IndexedDBIndexerStorage',
|
||||
name: this.IndexerStorageType.identifier,
|
||||
opts: {
|
||||
flavour: this.flavour,
|
||||
type: 'workspace',
|
||||
|
||||
Reference in New Issue
Block a user