@fluidframework/routerlicious-driver 2.0.0-internal.1.2.0.93071 → 2.0.0-internal.1.2.2

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 (49) hide show
  1. package/dist/documentDeltaConnection.d.ts.map +1 -1
  2. package/dist/documentDeltaConnection.js +3 -6
  3. package/dist/documentDeltaConnection.js.map +1 -1
  4. package/dist/documentServiceFactory.d.ts.map +1 -1
  5. package/dist/documentServiceFactory.js +3 -6
  6. package/dist/documentServiceFactory.js.map +1 -1
  7. package/dist/packageVersion.d.ts +1 -1
  8. package/dist/packageVersion.d.ts.map +1 -1
  9. package/dist/packageVersion.js +1 -1
  10. package/dist/packageVersion.js.map +1 -1
  11. package/dist/shreddedSummaryDocumentStorageService.d.ts +1 -0
  12. package/dist/shreddedSummaryDocumentStorageService.d.ts.map +1 -1
  13. package/dist/shreddedSummaryDocumentStorageService.js +7 -4
  14. package/dist/shreddedSummaryDocumentStorageService.js.map +1 -1
  15. package/dist/urlUtils.d.ts.map +1 -1
  16. package/dist/urlUtils.js +0 -1
  17. package/dist/urlUtils.js.map +1 -1
  18. package/dist/wholeSummaryDocumentStorageService.d.ts +1 -0
  19. package/dist/wholeSummaryDocumentStorageService.d.ts.map +1 -1
  20. package/dist/wholeSummaryDocumentStorageService.js +10 -6
  21. package/dist/wholeSummaryDocumentStorageService.js.map +1 -1
  22. package/lib/documentDeltaConnection.d.ts.map +1 -1
  23. package/lib/documentDeltaConnection.js +3 -6
  24. package/lib/documentDeltaConnection.js.map +1 -1
  25. package/lib/documentServiceFactory.d.ts.map +1 -1
  26. package/lib/documentServiceFactory.js +3 -6
  27. package/lib/documentServiceFactory.js.map +1 -1
  28. package/lib/packageVersion.d.ts +1 -1
  29. package/lib/packageVersion.d.ts.map +1 -1
  30. package/lib/packageVersion.js +1 -1
  31. package/lib/packageVersion.js.map +1 -1
  32. package/lib/shreddedSummaryDocumentStorageService.d.ts +1 -0
  33. package/lib/shreddedSummaryDocumentStorageService.d.ts.map +1 -1
  34. package/lib/shreddedSummaryDocumentStorageService.js +7 -4
  35. package/lib/shreddedSummaryDocumentStorageService.js.map +1 -1
  36. package/lib/urlUtils.d.ts.map +1 -1
  37. package/lib/urlUtils.js +0 -1
  38. package/lib/urlUtils.js.map +1 -1
  39. package/lib/wholeSummaryDocumentStorageService.d.ts +1 -0
  40. package/lib/wholeSummaryDocumentStorageService.d.ts.map +1 -1
  41. package/lib/wholeSummaryDocumentStorageService.js +10 -6
  42. package/lib/wholeSummaryDocumentStorageService.js.map +1 -1
  43. package/package.json +10 -10
  44. package/src/documentDeltaConnection.ts +3 -5
  45. package/src/documentServiceFactory.ts +3 -5
  46. package/src/packageVersion.ts +1 -1
  47. package/src/shreddedSummaryDocumentStorageService.ts +11 -4
  48. package/src/urlUtils.ts +0 -1
  49. package/src/wholeSummaryDocumentStorageService.ts +11 -6
@@ -120,7 +120,7 @@ export class WholeSummaryDocumentStorageService implements IDocumentStorageServi
120
120
  }
121
121
 
122
122
  public async readBlob(blobId: string): Promise<ArrayBufferLike> {
123
- const cachedBlob = await this.blobCache.get(blobId);
123
+ const cachedBlob = await this.blobCache.get(this.getCacheKey(blobId));
124
124
  if (cachedBlob !== undefined) {
125
125
  return cachedBlob;
126
126
  }
@@ -142,7 +142,7 @@ export class WholeSummaryDocumentStorageService implements IDocumentStorageServi
142
142
  );
143
143
  const bufferValue = stringToBuffer(blob.content, blob.encoding);
144
144
 
145
- await this.blobCache.put(blob.sha, bufferValue);
145
+ await this.blobCache.put(this.getCacheKey(blob.sha), bufferValue);
146
146
 
147
147
  return bufferValue;
148
148
  }
@@ -208,7 +208,7 @@ export class WholeSummaryDocumentStorageService implements IDocumentStorageServi
208
208
  }
209
209
 
210
210
  private async fetchAndCacheSnapshotTree(versionId: string, disableCache?: boolean): Promise<ISnapshotTreeVersion> {
211
- const cachedSnapshotTreeVersion = await this.snapshotTreeCache.get(versionId);
211
+ const cachedSnapshotTreeVersion = await this.snapshotTreeCache.get(this.getCacheKey(versionId));
212
212
  if (cachedSnapshotTreeVersion !== undefined) {
213
213
  return { id: cachedSnapshotTreeVersion.id, snapshotTree: cachedSnapshotTreeVersion.snapshotTree };
214
214
  }
@@ -236,7 +236,7 @@ export class WholeSummaryDocumentStorageService implements IDocumentStorageServi
236
236
 
237
237
  const cachePs: Promise<any>[] = [
238
238
  this.snapshotTreeCache.put(
239
- snapshotTreeId,
239
+ this.getCacheKey(snapshotTreeId),
240
240
  snapshotTreeVersion,
241
241
  ),
242
242
  this.initBlobCache(normalizedWholeSummary.blobs),
@@ -247,7 +247,7 @@ export class WholeSummaryDocumentStorageService implements IDocumentStorageServi
247
247
  // However, for something like Redis, this will cache the same value twice. Alternatively, could we simply
248
248
  // cache with versionId?
249
249
  cachePs.push(this.snapshotTreeCache.put(
250
- versionId,
250
+ this.getCacheKey(versionId),
251
251
  snapshotTreeVersion,
252
252
  ));
253
253
  }
@@ -260,8 +260,13 @@ export class WholeSummaryDocumentStorageService implements IDocumentStorageServi
260
260
  private async initBlobCache(blobs: Map<string, ArrayBuffer>): Promise<void> {
261
261
  const blobCachePutPs: Promise<void>[] = [];
262
262
  blobs.forEach((value, id) => {
263
- blobCachePutPs.push(this.blobCache.put(id, value));
263
+ const cacheKey = this.getCacheKey(id);
264
+ blobCachePutPs.push(this.blobCache.put(cacheKey, value));
264
265
  });
265
266
  await Promise.all(blobCachePutPs);
266
267
  }
268
+
269
+ private getCacheKey(blobId: string): string {
270
+ return `${this.id}:${blobId}`;
271
+ }
267
272
  }