@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.
Files changed (74) hide show
  1. package/.eslintrc.cjs +1 -4
  2. package/CHANGELOG.md +4 -0
  3. package/dist/channelContext.d.ts +7 -5
  4. package/dist/channelContext.d.ts.map +1 -1
  5. package/dist/channelContext.js +3 -1
  6. package/dist/channelContext.js.map +1 -1
  7. package/dist/channelDeltaConnection.d.ts +5 -5
  8. package/dist/channelDeltaConnection.d.ts.map +1 -1
  9. package/dist/channelDeltaConnection.js +7 -6
  10. package/dist/channelDeltaConnection.js.map +1 -1
  11. package/dist/channelStorageService.js +2 -2
  12. package/dist/channelStorageService.js.map +1 -1
  13. package/dist/dataStoreRuntime.d.ts.map +1 -1
  14. package/dist/dataStoreRuntime.js +65 -37
  15. package/dist/dataStoreRuntime.js.map +1 -1
  16. package/dist/fluidHandle.d.ts.map +1 -1
  17. package/dist/fluidHandle.js +6 -2
  18. package/dist/fluidHandle.js.map +1 -1
  19. package/dist/localChannelContext.d.ts +8 -6
  20. package/dist/localChannelContext.d.ts.map +1 -1
  21. package/dist/localChannelContext.js +8 -6
  22. package/dist/localChannelContext.js.map +1 -1
  23. package/dist/localChannelStorageService.d.ts.map +1 -1
  24. package/dist/localChannelStorageService.js +6 -4
  25. package/dist/localChannelStorageService.js.map +1 -1
  26. package/dist/packageVersion.d.ts +1 -1
  27. package/dist/packageVersion.d.ts.map +1 -1
  28. package/dist/packageVersion.js +1 -1
  29. package/dist/packageVersion.js.map +1 -1
  30. package/dist/remoteChannelContext.d.ts +7 -5
  31. package/dist/remoteChannelContext.d.ts.map +1 -1
  32. package/dist/remoteChannelContext.js +5 -4
  33. package/dist/remoteChannelContext.js.map +1 -1
  34. package/lib/channelContext.d.ts +7 -5
  35. package/lib/channelContext.d.ts.map +1 -1
  36. package/lib/channelContext.js +3 -1
  37. package/lib/channelContext.js.map +1 -1
  38. package/lib/channelDeltaConnection.d.ts +5 -5
  39. package/lib/channelDeltaConnection.d.ts.map +1 -1
  40. package/lib/channelDeltaConnection.js +7 -6
  41. package/lib/channelDeltaConnection.js.map +1 -1
  42. package/lib/channelStorageService.js +2 -2
  43. package/lib/channelStorageService.js.map +1 -1
  44. package/lib/dataStoreRuntime.d.ts.map +1 -1
  45. package/lib/dataStoreRuntime.js +65 -37
  46. package/lib/dataStoreRuntime.js.map +1 -1
  47. package/lib/fluidHandle.d.ts.map +1 -1
  48. package/lib/fluidHandle.js +6 -2
  49. package/lib/fluidHandle.js.map +1 -1
  50. package/lib/localChannelContext.d.ts +8 -6
  51. package/lib/localChannelContext.d.ts.map +1 -1
  52. package/lib/localChannelContext.js +8 -6
  53. package/lib/localChannelContext.js.map +1 -1
  54. package/lib/localChannelStorageService.d.ts.map +1 -1
  55. package/lib/localChannelStorageService.js +6 -4
  56. package/lib/localChannelStorageService.js.map +1 -1
  57. package/lib/packageVersion.d.ts +1 -1
  58. package/lib/packageVersion.d.ts.map +1 -1
  59. package/lib/packageVersion.js +1 -1
  60. package/lib/packageVersion.js.map +1 -1
  61. package/lib/remoteChannelContext.d.ts +7 -5
  62. package/lib/remoteChannelContext.d.ts.map +1 -1
  63. package/lib/remoteChannelContext.js +5 -4
  64. package/lib/remoteChannelContext.js.map +1 -1
  65. package/package.json +15 -15
  66. package/src/channelContext.ts +7 -5
  67. package/src/channelDeltaConnection.ts +19 -19
  68. package/src/channelStorageService.ts +3 -3
  69. package/src/dataStoreRuntime.ts +100 -64
  70. package/src/fluidHandle.ts +7 -3
  71. package/src/localChannelContext.ts +18 -16
  72. package/src/localChannelStorageService.ts +6 -4
  73. package/src/packageVersion.ts +1 -1
  74. 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 !== undefined ? blob.contents !== undefined : false;
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.substr(entry.path.length + 1), entry.value);
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
  }
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/datastore";
9
- export const pkgVersion = "2.41.0-338186";
9
+ export const pkgVersion = "2.41.0";
@@ -43,7 +43,9 @@ import { ISharedObjectRegistry } from "./dataStoreRuntime.js";
43
43
 
44
44
  export class RemoteChannelContext implements IChannelContext {
45
45
  private isLoaded = false;
46
- /** Tracks the messages for this channel that are sent while it's not loaded */
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: any, localOpMetadata: unknown) => void,
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
- const thisSummarizeInternal = async (
132
- fullTree: boolean,
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
- this.summarizerNode = createSummarizerNode(
145
- thisSummarizeInternal,
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: any): unknown {
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: Array.from(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: any, localOpMetadata: unknown, squash: boolean) {
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: any, localOpMetadata: unknown) {
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.