document-drive 1.29.4-dev.2 → 1.29.4-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/server/base-server.d.ts.map +1 -1
- package/dist/src/server/base-server.js +13 -1
- package/dist/src/server/listener/listener-manager.d.ts.map +1 -1
- package/dist/src/server/listener/listener-manager.js +67 -44
- package/dist/src/server/listener/transmitter/pull-responder.d.ts +8 -0
- package/dist/src/server/listener/transmitter/pull-responder.d.ts.map +1 -1
- package/dist/src/server/listener/transmitter/pull-responder.js +158 -67
- package/dist/src/server/listener/transmitter/types.d.ts +3 -1
- package/dist/src/server/listener/transmitter/types.d.ts.map +1 -1
- package/dist/src/server/sync-manager.d.ts.map +1 -1
- package/dist/src/server/sync-manager.js +18 -0
- package/dist/src/storage/prisma/client/default.d.ts +1 -0
- package/dist/src/storage/prisma/client/edge.d.ts +1 -0
- package/dist/src/storage/prisma/client/index.d.ts +10447 -0
- package/dist/src/storage/prisma/client/libquery_engine-debian-openssl-3.0.x.so.node +0 -0
- package/dist/src/storage/prisma/client/package.json +84 -0
- package/dist/src/storage/prisma/client/runtime/index-browser.d.ts +365 -0
- package/dist/src/storage/prisma/client/runtime/library.d.ts +3273 -0
- package/dist/src/storage/prisma/client/schema.prisma +91 -0
- package/dist/src/storage/prisma/client/wasm.d.ts +1 -0
- package/dist/src/storage/prisma/factory.d.ts.map +1 -1
- package/dist/src/storage/prisma/factory.js +1 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -18,11 +18,13 @@ export default class SynchronizationManager {
|
|
|
18
18
|
}
|
|
19
19
|
async getSynchronizationUnits(driveId, documentId, scope, branch, documentType) {
|
|
20
20
|
const synchronizationUnitsQuery = await this.getSynchronizationUnitsIds(driveId, documentId, scope, branch, documentType);
|
|
21
|
+
this.logger.verbose(`getSynchronizationUnits query: ${JSON.stringify(synchronizationUnitsQuery)}`);
|
|
21
22
|
return this.getSynchronizationUnitsRevision(driveId, synchronizationUnitsQuery);
|
|
22
23
|
}
|
|
23
24
|
async getSynchronizationUnitsRevision(driveId, syncUnitsQuery) {
|
|
24
25
|
const drive = await this.getDrive(driveId);
|
|
25
26
|
const revisions = await this.storage.getSynchronizationUnitsRevision(syncUnitsQuery);
|
|
27
|
+
this.logger.verbose(`getSynchronizationUnitsRevision: ${JSON.stringify(revisions)}`);
|
|
26
28
|
return syncUnitsQuery.map((s) => ({
|
|
27
29
|
...s,
|
|
28
30
|
lastUpdated: drive.created,
|
|
@@ -121,24 +123,40 @@ export default class SynchronizationManager {
|
|
|
121
123
|
};
|
|
122
124
|
}
|
|
123
125
|
async getOperationData(driveId, syncId, filter) {
|
|
126
|
+
this.logger.verbose(`[SYNC DEBUG] SynchronizationManager.getOperationData called for drive: ${driveId}, syncId: ${syncId}, filter: ${JSON.stringify(filter)}`);
|
|
124
127
|
const syncUnit = syncId === "0"
|
|
125
128
|
? { documentId: "", scope: "global" }
|
|
126
129
|
: await this.getSynchronizationUnitIdInfo(driveId, syncId);
|
|
127
130
|
if (!syncUnit) {
|
|
131
|
+
this.logger.error(`SYNC DEBUG] Invalid Sync Id ${syncId} in drive ${driveId}`);
|
|
128
132
|
throw new Error(`Invalid Sync Id ${syncId} in drive ${driveId}`);
|
|
129
133
|
}
|
|
134
|
+
this.logger.verbose(`[SYNC DEBUG] Found sync unit: documentId: ${syncUnit.documentId}, scope: ${syncUnit.scope}`);
|
|
130
135
|
const document = syncId === "0"
|
|
131
136
|
? await this.getDrive(driveId)
|
|
132
137
|
: await this.getDocument(driveId, syncUnit.documentId); // TODO replace with getDocumentOperations
|
|
138
|
+
this.logger.verbose(`[SYNC DEBUG] Retrieved document ${syncUnit.documentId} with type: ${document.documentType}`);
|
|
133
139
|
const operations = document.operations[syncUnit.scope] ?? []; // TODO filter by branch also
|
|
140
|
+
this.logger.verbose(`[SYNC DEBUG] Found ${operations.length} total operations in scope ${syncUnit.scope}`);
|
|
134
141
|
const filteredOperations = operations.filter((operation) => Object.keys(filter).length === 0 ||
|
|
135
142
|
((filter.since === undefined ||
|
|
136
143
|
isBefore(filter.since, operation.timestamp)) &&
|
|
137
144
|
(filter.fromRevision === undefined ||
|
|
138
145
|
operation.index > filter.fromRevision)));
|
|
146
|
+
this.logger.verbose(`[SYNC DEBUG] Filtered to ${filteredOperations.length} operations based on filter criteria` +
|
|
147
|
+
(filter.fromRevision !== undefined
|
|
148
|
+
? ` (fromRevision: ${filter.fromRevision})`
|
|
149
|
+
: ""));
|
|
139
150
|
const limitedOperations = filter.limit
|
|
140
151
|
? filteredOperations.slice(0, filter.limit)
|
|
141
152
|
: filteredOperations;
|
|
153
|
+
this.logger.verbose(`[SYNC DEBUG] Returning ${limitedOperations.length} operations after applying limit`);
|
|
154
|
+
if (limitedOperations.length > 0) {
|
|
155
|
+
const firstOp = limitedOperations[0];
|
|
156
|
+
const lastOp = limitedOperations[limitedOperations.length - 1];
|
|
157
|
+
this.logger.verbose(`[SYNC DEBUG] First operation: index=${firstOp.index}, type=${firstOp.type}`);
|
|
158
|
+
this.logger.verbose(`[SYNC DEBUG] Last operation: index=${lastOp.index}, type=${lastOp.type}`);
|
|
159
|
+
}
|
|
142
160
|
return limitedOperations.map((operation) => ({
|
|
143
161
|
hash: operation.hash,
|
|
144
162
|
index: operation.index,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './index'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './default'
|