@fluidframework/datastore 2.41.0-338186 → 2.41.0
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/.eslintrc.cjs +1 -4
- package/CHANGELOG.md +4 -0
- package/dist/channelContext.d.ts +7 -5
- package/dist/channelContext.d.ts.map +1 -1
- package/dist/channelContext.js +3 -1
- package/dist/channelContext.js.map +1 -1
- package/dist/channelDeltaConnection.d.ts +5 -5
- package/dist/channelDeltaConnection.d.ts.map +1 -1
- package/dist/channelDeltaConnection.js +7 -6
- package/dist/channelDeltaConnection.js.map +1 -1
- package/dist/channelStorageService.js +2 -2
- package/dist/channelStorageService.js.map +1 -1
- package/dist/dataStoreRuntime.d.ts.map +1 -1
- package/dist/dataStoreRuntime.js +65 -37
- package/dist/dataStoreRuntime.js.map +1 -1
- package/dist/fluidHandle.d.ts.map +1 -1
- package/dist/fluidHandle.js +6 -2
- package/dist/fluidHandle.js.map +1 -1
- package/dist/localChannelContext.d.ts +8 -6
- package/dist/localChannelContext.d.ts.map +1 -1
- package/dist/localChannelContext.js +8 -6
- package/dist/localChannelContext.js.map +1 -1
- package/dist/localChannelStorageService.d.ts.map +1 -1
- package/dist/localChannelStorageService.js +6 -4
- package/dist/localChannelStorageService.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/remoteChannelContext.d.ts +7 -5
- package/dist/remoteChannelContext.d.ts.map +1 -1
- package/dist/remoteChannelContext.js +5 -4
- package/dist/remoteChannelContext.js.map +1 -1
- package/lib/channelContext.d.ts +7 -5
- package/lib/channelContext.d.ts.map +1 -1
- package/lib/channelContext.js +3 -1
- package/lib/channelContext.js.map +1 -1
- package/lib/channelDeltaConnection.d.ts +5 -5
- package/lib/channelDeltaConnection.d.ts.map +1 -1
- package/lib/channelDeltaConnection.js +7 -6
- package/lib/channelDeltaConnection.js.map +1 -1
- package/lib/channelStorageService.js +2 -2
- package/lib/channelStorageService.js.map +1 -1
- package/lib/dataStoreRuntime.d.ts.map +1 -1
- package/lib/dataStoreRuntime.js +65 -37
- package/lib/dataStoreRuntime.js.map +1 -1
- package/lib/fluidHandle.d.ts.map +1 -1
- package/lib/fluidHandle.js +6 -2
- package/lib/fluidHandle.js.map +1 -1
- package/lib/localChannelContext.d.ts +8 -6
- package/lib/localChannelContext.d.ts.map +1 -1
- package/lib/localChannelContext.js +8 -6
- package/lib/localChannelContext.js.map +1 -1
- package/lib/localChannelStorageService.d.ts.map +1 -1
- package/lib/localChannelStorageService.js +6 -4
- package/lib/localChannelStorageService.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/remoteChannelContext.d.ts +7 -5
- package/lib/remoteChannelContext.d.ts.map +1 -1
- package/lib/remoteChannelContext.js +5 -4
- package/lib/remoteChannelContext.js.map +1 -1
- package/package.json +15 -15
- package/src/channelContext.ts +7 -5
- package/src/channelDeltaConnection.ts +19 -19
- package/src/channelStorageService.ts +3 -3
- package/src/dataStoreRuntime.ts +100 -64
- package/src/fluidHandle.ts +7 -3
- package/src/localChannelContext.ts +18 -16
- package/src/localChannelStorageService.ts +6 -4
- package/src/packageVersion.ts +1 -1
- package/src/remoteChannelContext.ts +19 -19
|
@@ -21,7 +21,7 @@ export class LocalChannelStorageService implements IChannelStorageService {
|
|
|
21
21
|
|
|
22
22
|
public async contains(path: string): Promise<boolean> {
|
|
23
23
|
const blob = this.readBlobSync(path);
|
|
24
|
-
return blob
|
|
24
|
+
return blob === undefined ? false : blob.contents !== undefined;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
public async list(path: string): Promise<string[]> {
|
|
@@ -35,17 +35,19 @@ export class LocalChannelStorageService implements IChannelStorageService {
|
|
|
35
35
|
private readBlobSyncInternal(path: string, tree: ITree): IBlob | undefined {
|
|
36
36
|
for (const entry of tree.entries) {
|
|
37
37
|
switch (entry.type) {
|
|
38
|
-
case TreeEntry.Blob:
|
|
38
|
+
case TreeEntry.Blob: {
|
|
39
39
|
if (path === entry.path) {
|
|
40
40
|
return entry.value;
|
|
41
41
|
}
|
|
42
42
|
break;
|
|
43
|
+
}
|
|
43
44
|
|
|
44
|
-
case TreeEntry.Tree:
|
|
45
|
+
case TreeEntry.Tree: {
|
|
45
46
|
if (path.startsWith(entry.path)) {
|
|
46
|
-
return this.readBlobSyncInternal(path.
|
|
47
|
+
return this.readBlobSyncInternal(path.slice(entry.path.length + 1), entry.value);
|
|
47
48
|
}
|
|
48
49
|
break;
|
|
50
|
+
}
|
|
49
51
|
|
|
50
52
|
default:
|
|
51
53
|
}
|
package/src/packageVersion.ts
CHANGED
|
@@ -43,7 +43,9 @@ import { ISharedObjectRegistry } from "./dataStoreRuntime.js";
|
|
|
43
43
|
|
|
44
44
|
export class RemoteChannelContext implements IChannelContext {
|
|
45
45
|
private isLoaded = false;
|
|
46
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* Tracks the messages for this channel that are sent while it's not loaded
|
|
48
|
+
*/
|
|
47
49
|
private pendingMessagesState: IPendingMessagesState | undefined = {
|
|
48
50
|
messageCollections: [],
|
|
49
51
|
pendingCount: 0,
|
|
@@ -60,7 +62,7 @@ export class RemoteChannelContext implements IChannelContext {
|
|
|
60
62
|
runtime: IFluidDataStoreRuntime,
|
|
61
63
|
dataStoreContext: IFluidDataStoreContext,
|
|
62
64
|
storageService: IDocumentStorageService,
|
|
63
|
-
submitFn: (content:
|
|
65
|
+
submitFn: (content: unknown, localOpMetadata: unknown) => void,
|
|
64
66
|
dirtyFn: (address: string) => void,
|
|
65
67
|
private readonly id: string,
|
|
66
68
|
baseSnapshot: ISnapshotTree,
|
|
@@ -128,21 +130,19 @@ export class RemoteChannelContext implements IChannelContext {
|
|
|
128
130
|
return this.channel;
|
|
129
131
|
});
|
|
130
132
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
trackState: boolean,
|
|
134
|
-
telemetryContext?: ITelemetryContext,
|
|
135
|
-
incrementalSummaryContext?: IExperimentalIncrementalSummaryContext,
|
|
136
|
-
) =>
|
|
137
|
-
this.summarizeInternal(
|
|
133
|
+
this.summarizerNode = createSummarizerNode(
|
|
134
|
+
async (
|
|
138
135
|
fullTree,
|
|
139
136
|
trackState,
|
|
140
137
|
telemetryContext,
|
|
141
138
|
incrementalSummaryContext,
|
|
142
|
-
)
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
139
|
+
): Promise<ISummarizeInternalResult> =>
|
|
140
|
+
this.summarizeInternal(
|
|
141
|
+
fullTree,
|
|
142
|
+
trackState,
|
|
143
|
+
telemetryContext,
|
|
144
|
+
incrementalSummaryContext,
|
|
145
|
+
),
|
|
146
146
|
async (fullGC?: boolean) => this.getGCDataInternal(fullGC),
|
|
147
147
|
);
|
|
148
148
|
|
|
@@ -157,7 +157,7 @@ export class RemoteChannelContext implements IChannelContext {
|
|
|
157
157
|
return this.channelP;
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
public setConnectionState(connected: boolean, clientId?: string) {
|
|
160
|
+
public setConnectionState(connected: boolean, clientId?: string): void {
|
|
161
161
|
// Connection events are ignored if the data store is not yet loaded
|
|
162
162
|
if (!this.isLoaded) {
|
|
163
163
|
return;
|
|
@@ -166,7 +166,7 @@ export class RemoteChannelContext implements IChannelContext {
|
|
|
166
166
|
this.services.deltaConnection.setConnectionState(connected);
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
public applyStashedOp(content:
|
|
169
|
+
public applyStashedOp(content: unknown): unknown {
|
|
170
170
|
assert(this.isLoaded, 0x194 /* "Remote channel must be loaded when rebasing op" */);
|
|
171
171
|
return this.services.deltaConnection.applyStashedOp(content);
|
|
172
172
|
}
|
|
@@ -189,7 +189,7 @@ export class RemoteChannelContext implements IChannelContext {
|
|
|
189
189
|
);
|
|
190
190
|
this.pendingMessagesState.messageCollections.push({
|
|
191
191
|
...messageCollection,
|
|
192
|
-
messagesContent:
|
|
192
|
+
messagesContent: [...messagesContent],
|
|
193
193
|
});
|
|
194
194
|
this.pendingMessagesState.pendingCount += messagesContent.length;
|
|
195
195
|
this.thresholdOpsCounter.sendIfMultiple(
|
|
@@ -199,13 +199,13 @@ export class RemoteChannelContext implements IChannelContext {
|
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
public reSubmit(content:
|
|
202
|
+
public reSubmit(content: unknown, localOpMetadata: unknown, squash: boolean): void {
|
|
203
203
|
assert(this.isLoaded, 0x196 /* "Remote channel must be loaded when resubmitting op" */);
|
|
204
204
|
|
|
205
205
|
this.services.deltaConnection.reSubmit(content, localOpMetadata, squash);
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
public rollback(content:
|
|
208
|
+
public rollback(content: unknown, localOpMetadata: unknown): void {
|
|
209
209
|
assert(this.isLoaded, 0x2f0 /* "Remote channel must be loaded when rolling back op" */);
|
|
210
210
|
|
|
211
211
|
this.services.deltaConnection.rollback(content, localOpMetadata);
|
|
@@ -263,7 +263,7 @@ export class RemoteChannelContext implements IChannelContext {
|
|
|
263
263
|
return channel.getGCData(fullGC);
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
-
public updateUsedRoutes(usedRoutes: string[]) {
|
|
266
|
+
public updateUsedRoutes(usedRoutes: string[]): void {
|
|
267
267
|
/**
|
|
268
268
|
* Currently, DDSes are always considered referenced and are not garbage collected. Update the summarizer node's
|
|
269
269
|
* used routes to contain a route to this channel context.
|