message: fix caching for blobs in r11s
diff: @@ -88,7 +88,12 @@ export class DocumentStorageService implements IDocumentStorageService {
  public async uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string> {
  const snapshot = context.ackHandle
  - ? await this.getVersions(context.ackHandle, 1).then(async (versions) => this.getSnapshotTree(versions[0]))
  + ? await this.getVersions(context.ackHandle, 1)
  + .then(async (versions) => {
  + // Clear the cache as the getSnapshotTree call will fill the cache.
  + this.blobsShaCache.clear();
  + return this.getSnapshotTree(versions[0]);
  + })
  : undefined;
  return this.writeSummaryTree(summary, snapshot ?? undefined);
  }
  @@ -255,9 +260,9 @@ export class DocumentStorageService implements IDocumentStorageService {
  // The gitHashFile would return the same hash as returned by the server as blob.sha
  const hash = gitHashFile(Buffer.from(parsedContent, encoding));
  if (!this.blobsShaCache.has(hash)) {
  + this.blobsShaCache.set(hash, "");
  const blob = await this.manager.createBlob(parsedContent, encoding);
  assert.strictEqual(hash, blob.sha, "Blob.sha and hash do not match!!");
  - this.blobsShaCache.set(blob.sha, "");
  }
  return hash;
  }
  