@fluidframework/datastore 2.0.0-dev-rc.1.0.0.228517 → 2.0.0-dev-rc.2.0.0.245554

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 (117) hide show
  1. package/{.eslintrc.js → .eslintrc.cjs} +4 -1
  2. package/{.mocharc.js → .mocharc.cjs} +1 -1
  3. package/CHANGELOG.md +42 -0
  4. package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
  5. package/api-extractor-lint.json +1 -1
  6. package/api-extractor.json +1 -1
  7. package/api-report/datastore.api.md +7 -11
  8. package/dist/channelContext.d.ts +5 -4
  9. package/dist/channelContext.d.ts.map +1 -1
  10. package/dist/channelContext.js +6 -5
  11. package/dist/channelContext.js.map +1 -1
  12. package/dist/channelDeltaConnection.d.ts +6 -3
  13. package/dist/channelDeltaConnection.d.ts.map +1 -1
  14. package/dist/channelDeltaConnection.js +46 -7
  15. package/dist/channelDeltaConnection.js.map +1 -1
  16. package/dist/dataStoreRuntime.d.ts +25 -6
  17. package/dist/dataStoreRuntime.d.ts.map +1 -1
  18. package/dist/dataStoreRuntime.js +145 -62
  19. package/dist/dataStoreRuntime.js.map +1 -1
  20. package/dist/datastore-alpha.d.ts +23 -6
  21. package/dist/datastore-beta.d.ts +1 -2
  22. package/dist/datastore-public.d.ts +1 -2
  23. package/dist/datastore-untrimmed.d.ts +23 -6
  24. package/dist/index.d.ts +2 -2
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +7 -7
  27. package/dist/index.js.map +1 -1
  28. package/dist/localChannelContext.d.ts +18 -3
  29. package/dist/localChannelContext.d.ts.map +1 -1
  30. package/dist/localChannelContext.js +32 -10
  31. package/dist/localChannelContext.js.map +1 -1
  32. package/dist/package.json +3 -0
  33. package/dist/remoteChannelContext.d.ts +2 -2
  34. package/dist/remoteChannelContext.d.ts.map +1 -1
  35. package/dist/remoteChannelContext.js +6 -5
  36. package/dist/remoteChannelContext.js.map +1 -1
  37. package/dist/tsdoc-metadata.json +1 -1
  38. package/lib/{channelContext.d.mts → channelContext.d.ts} +6 -5
  39. package/lib/channelContext.d.ts.map +1 -0
  40. package/lib/{channelContext.mjs → channelContext.js} +6 -5
  41. package/lib/channelContext.js.map +1 -0
  42. package/lib/{channelDeltaConnection.d.mts → channelDeltaConnection.d.ts} +7 -4
  43. package/lib/channelDeltaConnection.d.ts.map +1 -0
  44. package/lib/channelDeltaConnection.js +92 -0
  45. package/lib/channelDeltaConnection.js.map +1 -0
  46. package/lib/{channelStorageService.d.mts → channelStorageService.d.ts} +1 -1
  47. package/lib/channelStorageService.d.ts.map +1 -0
  48. package/lib/{channelStorageService.mjs → channelStorageService.js} +1 -1
  49. package/lib/channelStorageService.js.map +1 -0
  50. package/lib/{dataStoreRuntime.d.mts → dataStoreRuntime.d.ts} +26 -7
  51. package/lib/dataStoreRuntime.d.ts.map +1 -0
  52. package/lib/{dataStoreRuntime.mjs → dataStoreRuntime.js} +142 -59
  53. package/lib/dataStoreRuntime.js.map +1 -0
  54. package/lib/{datastore-alpha.d.mts → datastore-alpha.d.ts} +23 -6
  55. package/lib/{datastore-public.d.mts → datastore-beta.d.ts} +1 -2
  56. package/lib/{datastore-beta.d.mts → datastore-public.d.ts} +1 -2
  57. package/lib/{datastore-untrimmed.d.mts → datastore-untrimmed.d.ts} +23 -6
  58. package/lib/{fluidHandle.d.mts → fluidHandle.d.ts} +1 -1
  59. package/lib/fluidHandle.d.ts.map +1 -0
  60. package/lib/{fluidHandle.mjs → fluidHandle.js} +1 -1
  61. package/lib/fluidHandle.js.map +1 -0
  62. package/lib/{index.d.mts → index.d.ts} +3 -3
  63. package/lib/index.d.ts.map +1 -0
  64. package/lib/{index.mjs → index.js} +3 -3
  65. package/lib/index.js.map +1 -0
  66. package/lib/{localChannelContext.d.mts → localChannelContext.d.ts} +19 -4
  67. package/lib/localChannelContext.d.ts.map +1 -0
  68. package/lib/{localChannelContext.mjs → localChannelContext.js} +29 -7
  69. package/lib/localChannelContext.js.map +1 -0
  70. package/lib/{localChannelStorageService.d.mts → localChannelStorageService.d.ts} +1 -1
  71. package/lib/localChannelStorageService.d.ts.map +1 -0
  72. package/lib/{localChannelStorageService.mjs → localChannelStorageService.js} +1 -1
  73. package/lib/localChannelStorageService.js.map +1 -0
  74. package/lib/{remoteChannelContext.d.mts → remoteChannelContext.d.ts} +3 -3
  75. package/lib/remoteChannelContext.d.ts.map +1 -0
  76. package/lib/{remoteChannelContext.mjs → remoteChannelContext.js} +4 -3
  77. package/lib/remoteChannelContext.js.map +1 -0
  78. package/lib/test/channelStorageService.spec.js +70 -0
  79. package/lib/test/channelStorageService.spec.js.map +1 -0
  80. package/lib/test/dataStoreRuntime.spec.js +121 -0
  81. package/lib/test/dataStoreRuntime.spec.js.map +1 -0
  82. package/lib/test/localChannelContext.spec.js +41 -0
  83. package/lib/test/localChannelContext.spec.js.map +1 -0
  84. package/lib/test/localChannelStorageService.spec.js +72 -0
  85. package/lib/test/localChannelStorageService.spec.js.map +1 -0
  86. package/lib/test/remoteChannelContext.spec.js +33 -0
  87. package/lib/test/remoteChannelContext.spec.js.map +1 -0
  88. package/lib/test/types/validateDatastorePrevious.generated.js +16 -0
  89. package/lib/test/types/validateDatastorePrevious.generated.js.map +1 -0
  90. package/package.json +48 -50
  91. package/src/channelContext.ts +6 -3
  92. package/src/channelDeltaConnection.ts +69 -5
  93. package/src/dataStoreRuntime.ts +181 -81
  94. package/src/index.ts +2 -2
  95. package/src/localChannelContext.ts +38 -5
  96. package/src/remoteChannelContext.ts +4 -2
  97. package/tsconfig.cjs.json +7 -0
  98. package/tsconfig.json +2 -5
  99. package/lib/channelContext.d.mts.map +0 -1
  100. package/lib/channelContext.mjs.map +0 -1
  101. package/lib/channelDeltaConnection.d.mts.map +0 -1
  102. package/lib/channelDeltaConnection.mjs +0 -53
  103. package/lib/channelDeltaConnection.mjs.map +0 -1
  104. package/lib/channelStorageService.d.mts.map +0 -1
  105. package/lib/channelStorageService.mjs.map +0 -1
  106. package/lib/dataStoreRuntime.d.mts.map +0 -1
  107. package/lib/dataStoreRuntime.mjs.map +0 -1
  108. package/lib/fluidHandle.d.mts.map +0 -1
  109. package/lib/fluidHandle.mjs.map +0 -1
  110. package/lib/index.d.mts.map +0 -1
  111. package/lib/index.mjs.map +0 -1
  112. package/lib/localChannelContext.d.mts.map +0 -1
  113. package/lib/localChannelContext.mjs.map +0 -1
  114. package/lib/localChannelStorageService.d.mts.map +0 -1
  115. package/lib/localChannelStorageService.mjs.map +0 -1
  116. package/lib/remoteChannelContext.d.mts.map +0 -1
  117. package/lib/remoteChannelContext.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"localChannelContext.js","sourceRoot":"","sources":["../src/localChannelContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,SAAS,MAAM,QAAQ,CAAC;AAC/B,6DAA6D;AAC7D,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,CAAC;AAEhC,OAAO,EAAE,mBAAmB,EAAuB,MAAM,iCAAiC,CAAC;AAU3F,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAGvE,OAAO,EAEN,6BAA6B,EAE7B,WAAW,EACX,+BAA+B,EAC/B,gBAAgB,EAChB,qBAAqB,GACrB,MAAM,qBAAqB,CAAC;AAG7B;;GAEG;AACH,MAAM,OAAgB,uBAAuB;IAG5C,YACoB,EAAU,EACV,OAA+B,EAC/B,QAAuC,EACzC,QAA2B,EACpC,QAAmB;QAJR,OAAE,GAAF,EAAE,CAAQ;QACV,YAAO,GAAP,OAAO,CAAwB;QAC/B,aAAQ,GAAR,QAAQ,CAA+B;QACzC,aAAQ,GAAR,QAAQ,CAAmB;QACpC,aAAQ,GAAR,QAAQ,CAAW;QAPpB,oBAAe,GAAG,KAAK,CAAC;QACb,YAAO,GAAgC,EAAE,CAAC;QAQ5D,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,QA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7B;IACF,CAAC;CACD;AAED,MAAM,OAAO,mBAAoB,SAAQ,uBAAuB;IAE/D,YACiB,OAAiB,EACjC,OAA+B,EAC/B,gBAAwC,EACxC,cAAuC,EACvC,MAA2B,EAC3B,QAA0D,EAC1D,OAAkC,EAClC,0BAA2F;QAE3F,KAAK,CACJ,OAAO,CAAC,EAAE,EACV,OAAO,EACP,IAAI,IAAI,CAAC,GAAG,EAAE;YACb,OAAO,6BAA6B,CACnC,gBAAgB,CAAC,SAAS,EAC1B,QAAQ,EACR,IAAI,CAAC,OAAO,EACZ,0BAA0B,EAC1B,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAC5B,cAAc,EACd,MAAM,CACN,CAAC;QACH,CAAC,CAAC,EACF,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,EACxB,OAAO,CACP,CAAC;QAzBc,YAAO,GAAP,OAAO,CAAU;QA0BjC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,IAAI,CAAC,OAAO,GAAG,GAAG,EAAE;YACnB,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACrB,CAAC,CAAC;IACH,CAAC;IAEM,cAAc;QACpB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACpD,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport lodashPkg from \"lodash\";\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst { cloneDeep } = lodashPkg;\n\nimport { DataProcessingError, ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport { ISequencedDocumentMessage, ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport { IChannel, IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions\";\nimport {\n\tIFluidDataStoreContext,\n\tIGarbageCollectionData,\n\tISummarizeResult,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport { assert, Lazy, LazyPromise } from \"@fluidframework/core-utils\";\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { ISnapshotTreeWithBlobContents } from \"@fluidframework/container-definitions\";\nimport {\n\tChannelServiceEndpoints,\n\tcreateChannelServiceEndpoints,\n\tIChannelContext,\n\tloadChannel,\n\tloadChannelFactoryAndAttributes,\n\tsummarizeChannel,\n\tsummarizeChannelAsync,\n} from \"./channelContext.js\";\nimport { ISharedObjectRegistry } from \"./dataStoreRuntime.js\";\n\n/**\n * Channel context for a locally created channel\n */\nexport abstract class LocalChannelContextBase implements IChannelContext {\n\tprivate globallyVisible = false;\n\tprotected readonly pending: ISequencedDocumentMessage[] = [];\n\tconstructor(\n\t\tprotected readonly id: string,\n\t\tprotected readonly runtime: IFluidDataStoreRuntime,\n\t\tprotected readonly services: Lazy<ChannelServiceEndpoints>,\n\t\tprivate readonly channelP: Promise<IChannel>,\n\t\tprivate _channel?: IChannel,\n\t) {\n\t\tassert(!this.id.includes(\"/\"), 0x30f /* Channel context ID cannot contain slashes */);\n\t}\n\n\tprotected get isGloballyVisible() {\n\t\treturn this.globallyVisible;\n\t}\n\n\tpublic async getChannel(): Promise<IChannel> {\n\t\tif (this._channel === undefined) {\n\t\t\treturn this.channelP.then((c) => (this._channel = c));\n\t\t}\n\t\treturn this.channelP;\n\t}\n\n\tpublic get isLoaded(): boolean {\n\t\treturn this._channel !== undefined;\n\t}\n\n\tpublic setConnectionState(connected: boolean, clientId?: string) {\n\t\t// Connection events are ignored if the data store is not yet globallyVisible or loaded\n\t\tif (this.globallyVisible && this.isLoaded) {\n\t\t\tthis.services.value.deltaConnection.setConnectionState(connected);\n\t\t}\n\t}\n\n\tpublic processOp(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: unknown,\n\t): void {\n\t\tassert(\n\t\t\tthis.globallyVisible,\n\t\t\t0x2d3 /* \"Local channel must be globally visible when processing op\" */,\n\t\t);\n\n\t\t// A local channel may not be loaded in case where we rehydrate the container from a snapshot because of\n\t\t// delay loading. So after the container is attached and some other client joins which start generating\n\t\t// ops for this channel. So not loaded local channel can still receive ops and we store them to process later.\n\t\tif (this.isLoaded) {\n\t\t\tthis.services.value.deltaConnection.process(message, local, localOpMetadata);\n\t\t} else {\n\t\t\tassert(\n\t\t\t\tlocal === false,\n\t\t\t\t0x189 /* \"Should always be remote because a local dds shouldn't generate ops before loading\" */,\n\t\t\t);\n\t\t\tthis.pending.push(message);\n\t\t}\n\t}\n\n\tpublic reSubmit(content: any, localOpMetadata: unknown) {\n\t\tassert(this.isLoaded, 0x18a /* \"Channel should be loaded to resubmit ops\" */);\n\t\tassert(\n\t\t\tthis.globallyVisible,\n\t\t\t0x2d4 /* \"Local channel must be globally visible when resubmitting op\" */,\n\t\t);\n\t\tthis.services.value.deltaConnection.reSubmit(content, localOpMetadata);\n\t}\n\tpublic rollback(content: any, localOpMetadata: unknown) {\n\t\tassert(this.isLoaded, 0x2ee /* \"Channel should be loaded to rollback ops\" */);\n\t\tassert(\n\t\t\tthis.globallyVisible,\n\t\t\t0x2ef /* \"Local channel must be globally visible when rolling back op\" */,\n\t\t);\n\t\tthis.services.value.deltaConnection.rollback(content, localOpMetadata);\n\t}\n\n\tpublic abstract applyStashedOp(content: unknown): unknown;\n\n\t/**\n\t * Returns a summary at the current sequence number.\n\t * @param fullTree - true to bypass optimizations and force a full summary tree\n\t * @param trackState - This tells whether we should track state from this summary.\n\t * @param telemetryContext - summary data passed through the layers for telemetry purposes\n\t */\n\tpublic async summarize(\n\t\tfullTree: boolean = false,\n\t\ttrackState: boolean = false,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummarizeResult> {\n\t\tconst channel = await this.getChannel();\n\t\treturn summarizeChannelAsync(channel, fullTree, trackState, telemetryContext);\n\t}\n\n\t/**\n\t * For crafting the DataStore attach op. Only to be called when the channel is loaded (if applicable).\n\t *\n\t * Synchronously generates the channel's attach summary to be joined with the same from the DataStore's other channels\n\t */\n\tpublic getAttachSummary(telemetryContext?: ITelemetryContext): ISummarizeResult {\n\t\tassert(\n\t\t\tthis._channel !== undefined,\n\t\t\t0x18d /* \"Channel should be loaded to take snapshot\" */,\n\t\t);\n\t\treturn summarizeChannel(\n\t\t\tthis._channel,\n\t\t\ttrue /* fullTree */,\n\t\t\tfalse /* trackState */,\n\t\t\ttelemetryContext,\n\t\t);\n\t}\n\n\t/**\n\t * For crafting the DataStore attach op. Only to be called when the channel is loaded (if applicable).\n\t *\n\t * Synchronously generates the channel's attach GC data (set of outbound routes in the initial state)\n\t * to be joined with the same from the DataStore's other channels\n\t */\n\tpublic getAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData {\n\t\tassert(\n\t\t\tthis._channel !== undefined,\n\t\t\t0x8fd /* Local Channel should be loaded before being attached */,\n\t\t);\n\n\t\t// We need the GC Data to detect references added in this attach op\n\t\treturn this._channel.getGCData(/* fullGC: */ true);\n\t}\n\n\tpublic makeVisible(): void {\n\t\tif (this.globallyVisible) {\n\t\t\tthrow new Error(\"Channel is already globally visible\");\n\t\t}\n\n\t\tif (this.isLoaded) {\n\t\t\tassert(!!this._channel, 0x192 /* \"Channel should be there if loaded!!\" */);\n\t\t\tthis._channel.connect(this.services.value);\n\t\t}\n\t\tthis.globallyVisible = true;\n\t}\n\n\t/**\n\t * Returns the data used for garbage collection. This includes a list of GC nodes that represent this context.\n\t * Each node has a set of outbound routes to other GC nodes in the document. This should be called only after\n\t * the context has loaded.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tpublic async getGCData(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n\t\tconst channel = await this.getChannel();\n\t\treturn channel.getGCData(fullGC);\n\t}\n\n\tpublic updateUsedRoutes(usedRoutes: string[]) {\n\t\t/**\n\t\t * Currently, DDSes are always considered referenced and are not garbage collected.\n\t\t * Once we have GC at DDS level, this channel context's used routes will be updated as per the passed\n\t\t * value. See - https://github.com/microsoft/FluidFramework/issues/4611\n\t\t */\n\t}\n}\n\nexport class RehydratedLocalChannelContext extends LocalChannelContextBase {\n\tprivate readonly dirtyFn: () => void;\n\tconstructor(\n\t\tid: string,\n\t\tregistry: ISharedObjectRegistry,\n\t\truntime: IFluidDataStoreRuntime,\n\t\tdataStoreContext: IFluidDataStoreContext,\n\t\tstorageService: IDocumentStorageService,\n\t\tlogger: ITelemetryLoggerExt,\n\t\tsubmitFn: (content: any, localOpMetadata: unknown) => void,\n\t\tdirtyFn: (address: string) => void,\n\t\taddedGCOutboundReferenceFn: (srcHandle: IFluidHandle, outboundHandle: IFluidHandle) => void,\n\t\tprivate readonly snapshotTree: ISnapshotTree,\n\t) {\n\t\tsuper(\n\t\t\tid,\n\t\t\truntime,\n\t\t\tnew Lazy(() => {\n\t\t\t\tconst blobMap: Map<string, ArrayBufferLike> = new Map<string, ArrayBufferLike>();\n\t\t\t\tconst clonedSnapshotTree = cloneDeep(this.snapshotTree);\n\t\t\t\t// 0.47 back-compat Need to sanitize if snapshotTree.blobs still contains blob contents too.\n\t\t\t\t// This is for older snapshot which is generated by loader <=0.47 version which still contains\n\t\t\t\t// the contents within blobs. After a couple of revisions we can remove it.\n\t\t\t\tif (this.isSnapshotInOldFormatAndCollectBlobs(clonedSnapshotTree, blobMap)) {\n\t\t\t\t\tthis.sanitizeSnapshot(clonedSnapshotTree);\n\t\t\t\t}\n\t\t\t\treturn createChannelServiceEndpoints(\n\t\t\t\t\tdataStoreContext.connected,\n\t\t\t\t\tsubmitFn,\n\t\t\t\t\tthis.dirtyFn,\n\t\t\t\t\taddedGCOutboundReferenceFn,\n\t\t\t\t\t() => this.isGloballyVisible,\n\t\t\t\t\tstorageService,\n\t\t\t\t\tlogger,\n\t\t\t\t\tclonedSnapshotTree,\n\t\t\t\t\tblobMap,\n\t\t\t\t);\n\t\t\t}),\n\t\t\tnew LazyPromise<IChannel>(async () => {\n\t\t\t\ttry {\n\t\t\t\t\tconst { attributes, factory } = await loadChannelFactoryAndAttributes(\n\t\t\t\t\t\tdataStoreContext,\n\t\t\t\t\t\tthis.services.value,\n\t\t\t\t\t\tthis.id,\n\t\t\t\t\t\tregistry,\n\t\t\t\t\t);\n\t\t\t\t\tconst channel = await loadChannel(\n\t\t\t\t\t\truntime,\n\t\t\t\t\t\tattributes,\n\t\t\t\t\t\tfactory,\n\t\t\t\t\t\tthis.services.value,\n\t\t\t\t\t\tlogger,\n\t\t\t\t\t\tthis.id,\n\t\t\t\t\t);\n\t\t\t\t\t// Send all pending messages to the channel\n\t\t\t\t\tfor (const message of this.pending) {\n\t\t\t\t\t\tthis.services.value.deltaConnection.process(\n\t\t\t\t\t\t\tmessage,\n\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\tundefined /* localOpMetadata */,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn channel;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tthrow DataProcessingError.wrapIfUnrecognized(\n\t\t\t\t\t\terr,\n\t\t\t\t\t\t\"rehydratedLocalChannelContextFailedToLoadChannel\",\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}),\n\t\t);\n\n\t\tthis.dirtyFn = () => {\n\t\t\tdirtyFn(id);\n\t\t};\n\t}\n\n\tpublic override applyStashedOp(content) {\n\t\treturn this.services.value.deltaConnection.applyStashedOp(content);\n\t}\n\n\tprivate isSnapshotInOldFormatAndCollectBlobs(\n\t\tsnapshotTree: ISnapshotTreeWithBlobContents,\n\t\tblobMap: Map<string, ArrayBufferLike>,\n\t): boolean {\n\t\tlet sanitize = false;\n\t\tconst blobsContents = snapshotTree.blobsContents;\n\t\tif (blobsContents !== undefined) {\n\t\t\tObject.entries(blobsContents).forEach(([key, value]) => {\n\t\t\t\tblobMap.set(key, value);\n\t\t\t\tif (snapshotTree.blobs[key] !== undefined) {\n\t\t\t\t\tsanitize = true;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tfor (const value of Object.values(snapshotTree.trees)) {\n\t\t\tsanitize = sanitize || this.isSnapshotInOldFormatAndCollectBlobs(value, blobMap);\n\t\t}\n\t\treturn sanitize;\n\t}\n\n\tprivate sanitizeSnapshot(snapshotTree: ISnapshotTree) {\n\t\tconst blobMapInitial = new Map(Object.entries(snapshotTree.blobs));\n\t\tfor (const [blobName, blobId] of blobMapInitial.entries()) {\n\t\t\tconst blobValue = blobMapInitial.get(blobId);\n\t\t\tif (blobValue === undefined) {\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n\t\t\t\tdelete snapshotTree.blobs[blobName];\n\t\t\t}\n\t\t}\n\t\tfor (const value of Object.values(snapshotTree.trees)) {\n\t\t\tthis.sanitizeSnapshot(value);\n\t\t}\n\t}\n}\n\nexport class LocalChannelContext extends LocalChannelContextBase {\n\tprivate readonly dirtyFn: () => void;\n\tconstructor(\n\t\tpublic readonly channel: IChannel,\n\t\truntime: IFluidDataStoreRuntime,\n\t\tdataStoreContext: IFluidDataStoreContext,\n\t\tstorageService: IDocumentStorageService,\n\t\tlogger: ITelemetryLoggerExt,\n\t\tsubmitFn: (content: any, localOpMetadata: unknown) => void,\n\t\tdirtyFn: (address: string) => void,\n\t\taddedGCOutboundReferenceFn: (srcHandle: IFluidHandle, outboundHandle: IFluidHandle) => void,\n\t) {\n\t\tsuper(\n\t\t\tchannel.id,\n\t\t\truntime,\n\t\t\tnew Lazy(() => {\n\t\t\t\treturn createChannelServiceEndpoints(\n\t\t\t\t\tdataStoreContext.connected,\n\t\t\t\t\tsubmitFn,\n\t\t\t\t\tthis.dirtyFn,\n\t\t\t\t\taddedGCOutboundReferenceFn,\n\t\t\t\t\t() => this.isGloballyVisible,\n\t\t\t\t\tstorageService,\n\t\t\t\t\tlogger,\n\t\t\t\t);\n\t\t\t}),\n\t\t\tPromise.resolve(channel),\n\t\t\tchannel,\n\t\t);\n\t\tthis.channel = channel;\n\n\t\tthis.dirtyFn = () => {\n\t\t\tdirtyFn(channel.id);\n\t\t};\n\t}\n\n\tpublic applyStashedOp() {\n\t\tthrow new Error(\"no stashed ops on local channel\");\n\t}\n}\n"]}
@@ -13,4 +13,4 @@ export declare class LocalChannelStorageService implements IChannelStorageServic
13
13
  private readBlobSync;
14
14
  private readBlobSyncInternal;
15
15
  }
16
- //# sourceMappingURL=localChannelStorageService.d.mts.map
16
+ //# sourceMappingURL=localChannelStorageService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"localChannelStorageService.d.ts","sourceRoot":"","sources":["../src/localChannelStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,OAAO,EAAS,KAAK,EAAa,MAAM,sCAAsC,CAAC;AAG/E,qBAAa,0BAA2B,YAAW,sBAAsB;IAC5D,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,KAAK;IAE3B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAQhD,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKxC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAIlD,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,oBAAoB;CAwB5B"}
@@ -45,4 +45,4 @@ export class LocalChannelStorageService {
45
45
  return undefined;
46
46
  }
47
47
  }
48
- //# sourceMappingURL=localChannelStorageService.mjs.map
48
+ //# sourceMappingURL=localChannelStorageService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"localChannelStorageService.js","sourceRoot":"","sources":["../src/localChannelStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAgB,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,mBAAmB,E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AChC,OAAO,IAAI,CAAC,oBAAoB,CAC/B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,EAClC,KAAK,CAAC,KAAK,CACX,CAAC;qBACF;oBACD,MAAM;gBAEP,QAAQ;aACR;SACD;QAED,OAAO,SAAS,CAAC;IAClB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IChannelStorageService } from \"@fluidframework/datastore-definitions\";\nimport { stringToBuffer } from \"@fluid-internal/client-utils\";\nimport { IBlob, ITree, TreeEntry } from \"@fluidframework/protocol-definitions\";\nimport { listBlobsAtTreePath } from \"@fluidframework/runtime-utils\";\n\nexport class LocalChannelStorageService implements IChannelStorageService {\n\tconstructor(private readonly tree: ITree) {}\n\n\tpublic async readBlob(path: string): Promise<ArrayBufferLike> {\n\t\tconst blob = this.readBlobSync(path);\n\t\tif (blob === undefined) {\n\t\t\tthrow new Error(\"Blob Not Found\");\n\t\t}\n\t\treturn stringToBuffer(blob.contents, blob.encoding);\n\t}\n\n\tpublic async contains(path: string): Promise<boolean> {\n\t\tconst blob = this.readBlobSync(path);\n\t\treturn blob !== undefined ? blob.contents !== undefined : false;\n\t}\n\n\tpublic async list(path: string): Promise<string[]> {\n\t\treturn listBlobsAtTreePath(this.tree, path);\n\t}\n\n\tprivate readBlobSync(path: string): IBlob | undefined {\n\t\treturn this.readBlobSyncInternal(path, this.tree);\n\t}\n\n\tprivate readBlobSyncInternal(path: string, tree: ITree): IBlob | undefined {\n\t\tfor (const entry of tree.entries) {\n\t\t\tswitch (entry.type) {\n\t\t\t\tcase TreeEntry.Blob:\n\t\t\t\t\tif (path === entry.path) {\n\t\t\t\t\t\treturn entry.value;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase TreeEntry.Tree:\n\t\t\t\t\tif (path.startsWith(entry.path)) {\n\t\t\t\t\t\treturn this.readBlobSyncInternal(\n\t\t\t\t\t\t\tpath.substr(entry.path.length + 1),\n\t\t\t\t\t\t\tentry.value,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n}\n"]}
@@ -7,8 +7,8 @@ import { IChannel, IFluidDataStoreRuntime } from "@fluidframework/datastore-defi
7
7
  import { IDocumentStorageService } from "@fluidframework/driver-definitions";
8
8
  import { ISequencedDocumentMessage, ISnapshotTree } from "@fluidframework/protocol-definitions";
9
9
  import { CreateChildSummarizerNodeFn, IFluidDataStoreContext, IGarbageCollectionData, ISummarizeResult, ITelemetryContext } from "@fluidframework/runtime-definitions";
10
- import { IChannelContext } from "./channelContext.mjs";
11
- import { ISharedObjectRegistry } from "./dataStoreRuntime.mjs";
10
+ import { IChannelContext } from "./channelContext.js";
11
+ import { ISharedObjectRegistry } from "./dataStoreRuntime.js";
12
12
  export declare class RemoteChannelContext implements IChannelContext {
13
13
  private readonly id;
14
14
  private isLoaded;
@@ -51,4 +51,4 @@ export declare class RemoteChannelContext implements IChannelContext {
51
51
  private getGCDataInternal;
52
52
  updateUsedRoutes(usedRoutes: string[]): void;
53
53
  }
54
- //# sourceMappingURL=remoteChannelContext.d.mts.map
54
+ //# sourceMappingURL=remoteChannelContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remoteChannelContext.d.ts","sourceRoot":"","sources":["../src/remoteChannelContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AACzF,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,yBAAyB,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAChG,OAAO,EACN,2BAA2B,EAC3B,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E,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM;IASxD,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO;IAKrC,SAAS,CACf,OAAO,EAAE,yBAAyB,EAClC,KAAK,EAAE,OAAO,EACd,eAAe,EAAE,OAAO,GACtB,IAAI;IAaA,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO;IAM/C,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO;IAMtD;;;;;OAKG;IACU,SAAS,CACrB,QAAQ,GAAE,OAAe,EACzB,UAAU,GAAE,OAAc,EAC1B,gBAAgB,CAAC,EAAE,iBAAiB,GAClC,OAAO,CAAC,gBAAgB,CAAC;YAId,iBAAiB;IAiB/B;;;;;;OAMG;IACU,SAAS,CAAC,MAAM,GAAE,OAAe,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAIhF;;;;OAIG;YACW,iBAAiB;IAKxB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE;CAS5C"}
@@ -4,7 +4,8 @@
4
4
  */
5
5
  import { assert, LazyPromise } from "@fluidframework/core-utils";
6
6
  import { createChildLogger, ThresholdCounter, } from "@fluidframework/telemetry-utils";
7
- import { createChannelServiceEndpoints, loadChannel, loadChannelFactoryAndAttributes, summarizeChannelAsync, } from "./channelContext.mjs";
7
+ import { AttachState } from "@fluidframework/container-definitions";
8
+ import { createChannelServiceEndpoints, loadChannel, loadChannelFactoryAndAttributes, summarizeChannelAsync, } from "./channelContext.js";
8
9
  export class RemoteChannelContext {
9
10
  constructor(runtime, dataStoreContext, storageService, submitFn, dirtyFn, addedGCOutboundReferenceFn, id, baseSnapshot, registry, extraBlobs, createSummarizerNode, attachMessageType) {
10
11
  this.id = id;
@@ -15,7 +16,7 @@ export class RemoteChannelContext {
15
16
  logger: runtime.logger,
16
17
  namespace: "RemoteChannelContext",
17
18
  });
18
- this.services = createChannelServiceEndpoints(dataStoreContext.connected, submitFn, () => dirtyFn(this.id), addedGCOutboundReferenceFn, storageService, this.subLogger, baseSnapshot, extraBlobs);
19
+ this.services = createChannelServiceEndpoints(dataStoreContext.connected, submitFn, () => dirtyFn(this.id), addedGCOutboundReferenceFn, () => runtime.attachState !== AttachState.Detached, storageService, this.subLogger, baseSnapshot, extraBlobs);
19
20
  this.channelP = new LazyPromise(async () => {
20
21
  const { attributes, factory } = await loadChannelFactoryAndAttributes(dataStoreContext, this.services, this.id, registry, attachMessageType);
21
22
  const channel = await loadChannel(runtime, attributes, factory, this.services, this.subLogger, this.id);
@@ -117,4 +118,4 @@ export class RemoteChannelContext {
117
118
  }
118
119
  }
119
120
  RemoteChannelContext.pendingOpsCountThreshold = 1000;
120
- //# sourceMappingURL=remoteChannelContext.mjs.map
121
+ //# sourceMappingURL=remoteChannelContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remoteChannelContext.js","sourceRoot":"","sources":["../src/remoteChannelContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAejE,OAAO,EACN,iBAAiB,EAEjB,gBAAgB,GAChB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAEN,6BAA6B,EAE7B,WAAW,EACX,+BAA+B,EAC/B,qBAAqB,GACrB,MAAM,qBAAqB,CAAC;AAG7B,MAAM,OAAO,oBAAoB;IAWhC,YACC,OAA+B,EAC/B,gBAAwC,EACxC,cAAuC,EACvC,QAA0D,EAC1D,OAAkC,EAClC,0BAA2F,EAC1E,EAAU,EAC3B,YAA2B,EAC3B,QAA+B,EAC/B,UAAoD,EACpD,oBAAiD,EACjD,iBAA0B;QALT,OAAE,GAAF,EAAE,CAAQ;QAjBpB,aAAQ,GAAG,KAAK,CAAC;QACjB,YAAO,GAA4C,EAAE,CAAC;QAuB7D,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,C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AgB,CAAC,CAAC;IAC9E,CAAC;IAEO,KAAK,CAAC,iBAAiB,CAC9B,QAAiB,EACjB,UAAmB,EACnB,gBAAoC,EACpC,yBAAkE;QAElE,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QACxC,MAAM,eAAe,GAAG,MAAM,qBAAqB,CAClD,OAAO,EACP,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,yBAAyB,CACzB,CAAC;QACF,OAAO,EAAE,GAAG,eAAe,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC;IAC5C,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,SAAS,CAAC,SAAkB,KAAK;QAC7C,OAAO,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;IAED;;;;OAIG;IACK,KAAK,CAAC,iBAAiB,CAAC,SAAkB,KAAK;QACtD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QACxC,OAAO,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;IAEM,gBAAgB,CAAC,UAAoB;QAC3C;;;;;WAKG;QACH,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC5C,CAAC;;AA/MuB,6CAAwB,GAAG,IAAI,AAAP,CAAQ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, LazyPromise } from \"@fluidframework/core-utils\";\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { IChannel, IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport { ISequencedDocumentMessage, ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport {\n\tCreateChildSummarizerNodeFn,\n\tIFluidDataStoreContext,\n\tIGarbageCollectionData,\n\tIExperimentalIncrementalSummaryContext,\n\tISummarizeInternalResult,\n\tISummarizeResult,\n\tISummarizerNodeWithGC,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport {\n\tcreateChildLogger,\n\tITelemetryLoggerExt,\n\tThresholdCounter,\n} from \"@fluidframework/telemetry-utils\";\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport {\n\tChannelServiceEndpoints,\n\tcreateChannelServiceEndpoints,\n\tIChannelContext,\n\tloadChannel,\n\tloadChannelFactoryAndAttributes,\n\tsummarizeChannelAsync,\n} from \"./channelContext.js\";\nimport { ISharedObjectRegistry } from \"./dataStoreRuntime.js\";\n\nexport class RemoteChannelContext implements IChannelContext {\n\tprivate isLoaded = false;\n\tprivate pending: ISequencedDocumentMessage[] | undefined = [];\n\tprivate readonly channelP: Promise<IChannel>;\n\tprivate channel: IChannel | undefined;\n\tprivate readonly services: ChannelServiceEndpoints;\n\tprivate readonly summarizerNode: ISummarizerNodeWithGC;\n\tprivate readonly subLogger: ITelemetryLoggerExt;\n\tprivate readonly thresholdOpsCounter: ThresholdCounter;\n\tprivate static readonly pendingOpsCountThreshold = 1000;\n\n\tconstructor(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tdataStoreContext: IFluidDataStoreContext,\n\t\tstorageService: IDocumentStorageService,\n\t\tsubmitFn: (content: any, localOpMetadata: unknown) => void,\n\t\tdirtyFn: (address: string) => void,\n\t\taddedGCOutboundReferenceFn: (srcHandle: IFluidHandle, outboundHandle: IFluidHandle) => void,\n\t\tprivate readonly id: string,\n\t\tbaseSnapshot: ISnapshotTree,\n\t\tregistry: ISharedObjectRegistry,\n\t\textraBlobs: Map<string, ArrayBufferLike> | undefined,\n\t\tcreateSummarizerNode: CreateChildSummarizerNodeFn,\n\t\tattachMessageType?: string,\n\t) {\n\t\tassert(!this.id.includes(\"/\"), 0x310 /* Channel context ID cannot contain slashes */);\n\n\t\tthis.subLogger = createChildLogger({\n\t\t\tlogger: runtime.logger,\n\t\t\tnamespace: \"RemoteChannelContext\",\n\t\t});\n\n\t\tthis.services = createChannelServiceEndpoints(\n\t\t\tdataStoreContext.connected,\n\t\t\tsubmitFn,\n\t\t\t() => dirtyFn(this.id),\n\t\t\taddedGCOutboundReferenceFn,\n\t\t\t() => runtime.attachState !== AttachState.Detached,\n\t\t\tstorageService,\n\t\t\tthis.subLogger,\n\t\t\tbaseSnapshot,\n\t\t\textraBlobs,\n\t\t);\n\n\t\tthis.channelP = new LazyPromise<IChannel>(async () => {\n\t\t\tconst { attributes, factory } = await loadChannelFactoryAndAttributes(\n\t\t\t\tdataStoreContext,\n\t\t\t\tthis.services,\n\t\t\t\tthis.id,\n\t\t\t\tregistry,\n\t\t\t\tattachMessageType,\n\t\t\t);\n\n\t\t\tconst channel = await loadChannel(\n\t\t\t\truntime,\n\t\t\t\tattributes,\n\t\t\t\tfactory,\n\t\t\t\tthis.services,\n\t\t\t\tthis.subLogger,\n\t\t\t\tthis.id,\n\t\t\t);\n\n\t\t\t// Send all pending messages to the channel\n\t\t\tassert(this.pending !== undefined, 0x23f /* \"pending undefined\" */);\n\t\t\tfor (const message of this.pending) {\n\t\t\t\tthis.services.deltaConnection.process(\n\t\t\t\t\tmessage,\n\t\t\t\t\tfalse,\n\t\t\t\t\tundefined /* localOpMetadata */,\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.thresholdOpsCounter.send(\"ProcessPendingOps\", this.pending.length);\n\n\t\t\t// Commit changes.\n\t\t\tthis.channel = channel;\n\t\t\tthis.pending = undefined;\n\t\t\tthis.isLoaded = true;\n\n\t\t\t// Because have some await between we created the service and here, the connection state might have changed\n\t\t\t// and we don't propagate the connection state when we are not loaded. So we have to set it again here.\n\t\t\tthis.services.deltaConnection.setConnectionState(dataStoreContext.connected);\n\t\t\treturn this.channel;\n\t\t});\n\n\t\tconst thisSummarizeInternal = async (\n\t\t\tfullTree: boolean,\n\t\t\ttrackState: boolean,\n\t\t\ttelemetryContext?: ITelemetryContext,\n\t\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext,\n\t\t) =>\n\t\t\tthis.summarizeInternal(\n\t\t\t\tfullTree,\n\t\t\t\ttrackState,\n\t\t\t\ttelemetryContext,\n\t\t\t\tincrementalSummaryContext,\n\t\t\t);\n\n\t\tthis.summarizerNode = createSummarizerNode(\n\t\t\tthisSummarizeInternal,\n\t\t\tasync (fullGC?: boolean) => this.getGCDataInternal(fullGC),\n\t\t);\n\n\t\tthis.thresholdOpsCounter = new ThresholdCounter(\n\t\t\tRemoteChannelContext.pendingOpsCountThreshold,\n\t\t\tthis.subLogger,\n\t\t);\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/promise-function-async\n\tpublic getChannel(): Promise<IChannel> {\n\t\treturn this.channelP;\n\t}\n\n\tpublic setConnectionState(connected: boolean, clientId?: string) {\n\t\t// Connection events are ignored if the data store is not yet loaded\n\t\tif (!this.isLoaded) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.services.deltaConnection.setConnectionState(connected);\n\t}\n\n\tpublic applyStashedOp(content: any): unknown {\n\t\tassert(this.isLoaded, 0x194 /* \"Remote channel must be loaded when rebasing op\" */);\n\t\treturn this.services.deltaConnection.applyStashedOp(content);\n\t}\n\n\tpublic processOp(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: unknown,\n\t): void {\n\t\tthis.summarizerNode.invalidate(message.sequenceNumber);\n\n\t\tif (this.isLoaded) {\n\t\t\tthis.services.deltaConnection.process(message, local, localOpMetadata);\n\t\t} else {\n\t\t\tassert(!local, 0x195 /* \"Remote channel must not be local when processing op\" */);\n\t\t\tassert(this.pending !== undefined, 0x23e /* \"pending is undefined\" */);\n\t\t\tthis.pending.push(message);\n\t\t\tthis.thresholdOpsCounter.sendIfMultiple(\"StorePendingOps\", this.pending.length);\n\t\t}\n\t}\n\n\tpublic reSubmit(content: any, localOpMetadata: unknown) {\n\t\tassert(this.isLoaded, 0x196 /* \"Remote channel must be loaded when resubmitting op\" */);\n\n\t\tthis.services.deltaConnection.reSubmit(content, localOpMetadata);\n\t}\n\n\tpublic rollback(content: any, localOpMetadata: unknown) {\n\t\tassert(this.isLoaded, 0x2f0 /* \"Remote channel must be loaded when rolling back op\" */);\n\n\t\tthis.services.deltaConnection.rollback(content, localOpMetadata);\n\t}\n\n\t/**\n\t * Returns a summary at the current sequence number.\n\t * @param fullTree - true to bypass optimizations and force a full summary tree\n\t * @param trackState - This tells whether we should track state from this summary.\n\t * @param telemetryContext - summary data passed through the layers for telemetry purposes\n\t */\n\tpublic async summarize(\n\t\tfullTree: boolean = false,\n\t\ttrackState: boolean = true,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummarizeResult> {\n\t\treturn this.summarizerNode.summarize(fullTree, trackState, telemetryContext);\n\t}\n\n\tprivate async summarizeInternal(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext,\n\t): Promise<ISummarizeInternalResult> {\n\t\tconst channel = await this.getChannel();\n\t\tconst summarizeResult = await summarizeChannelAsync(\n\t\t\tchannel,\n\t\t\tfullTree,\n\t\t\ttrackState,\n\t\t\ttelemetryContext,\n\t\t\tincrementalSummaryContext,\n\t\t);\n\t\treturn { ...summarizeResult, id: this.id };\n\t}\n\n\t/**\n\t * Returns the data used for garbage collection. This includes a list of GC nodes that represent this context.\n\t * Each node has a set of outbound routes to other GC nodes in the document.\n\t * If there is no new data in this context since the last summary, previous GC data is used.\n\t * If there is new data, the GC data is generated again (by calling getGCDataInternal).\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tpublic async getGCData(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n\t\treturn this.summarizerNode.getGCData(fullGC);\n\t}\n\n\t/**\n\t * Generates the data used for garbage collection. This is called when there is new data since last summary. It\n\t * loads the context and calls into the channel to get its GC data.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tprivate async getGCDataInternal(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n\t\tconst channel = await this.getChannel();\n\t\treturn channel.getGCData(fullGC);\n\t}\n\n\tpublic updateUsedRoutes(usedRoutes: string[]) {\n\t\t/**\n\t\t * Currently, DDSes are always considered referenced and are not garbage collected. Update the summarizer node's\n\t\t * used routes to contain a route to this channel context.\n\t\t * Once we have GC at DDS level, this will be updated to use the passed usedRoutes. See -\n\t\t * https://github.com/microsoft/FluidFramework/issues/4611\n\t\t */\n\t\tthis.summarizerNode.updateUsedRoutes([\"\"]);\n\t}\n}\n"]}
@@ -0,0 +1,70 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { strict as assert } from "assert";
6
+ import { stringToBuffer } from "@fluid-internal/client-utils";
7
+ import { MockLogger } from "@fluidframework/telemetry-utils";
8
+ import { ChannelStorageService } from "../channelStorageService.js";
9
+ describe("ChannelStorageService", () => {
10
+ it("Empty Tree", async () => {
11
+ const tree = {
12
+ blobs: {},
13
+ trees: {},
14
+ };
15
+ const storage = {
16
+ readBlob: async (id) => {
17
+ throw new Error("not implemented");
18
+ },
19
+ };
20
+ const logger = new MockLogger();
21
+ const ss = new ChannelStorageService(tree, storage, logger.toTelemetryLogger());
22
+ assert.strictEqual(await ss.contains("/"), false);
23
+ assert.deepStrictEqual(await ss.list(""), []);
24
+ logger.assertMatchNone([{ category: "error" }]);
25
+ });
26
+ it("Top Level Blob", async () => {
27
+ const tree = {
28
+ blobs: {
29
+ foo: "bar",
30
+ },
31
+ trees: {},
32
+ };
33
+ const storage = {
34
+ readBlob: async (id) => {
35
+ return stringToBuffer(id, "utf8");
36
+ },
37
+ };
38
+ const logger = new MockLogger();
39
+ const ss = new ChannelStorageService(tree, storage, logger.toTelemetryLogger());
40
+ assert.strictEqual(await ss.contains("foo"), true);
41
+ assert.deepStrictEqual(await ss.list(""), ["foo"]);
42
+ assert.deepStrictEqual(await ss.readBlob("foo"), stringToBuffer("bar", "utf8"));
43
+ logger.assertMatchNone([{ category: "error" }]);
44
+ });
45
+ it("Nested Blob", async () => {
46
+ const tree = {
47
+ blobs: {},
48
+ trees: {
49
+ nested: {
50
+ blobs: {
51
+ foo: "bar",
52
+ },
53
+ trees: {},
54
+ },
55
+ },
56
+ };
57
+ const storage = {
58
+ readBlob: async (id) => {
59
+ return stringToBuffer(id, "utf8");
60
+ },
61
+ };
62
+ const logger = new MockLogger();
63
+ const ss = new ChannelStorageService(tree, storage, logger.toTelemetryLogger());
64
+ assert.strictEqual(await ss.contains("nested/foo"), true);
65
+ assert.deepStrictEqual(await ss.list("nested/"), ["foo"]);
66
+ assert.deepStrictEqual(await ss.readBlob("nested/foo"), stringToBuffer("bar", "utf8"));
67
+ logger.assertMatchNone([{ category: "error" }]);
68
+ });
69
+ });
70
+ //# sourceMappingURL=channelStorageService.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channelStorageService.spec.js","sourceRoot":"","sources":["../../src/test/channelStorageService.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAG7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACtC,EAAE,CAAC,YAAY,EAAE,KAAK,IAAI,EAAE;QAC3B,MAAM,IAAI,GAAkB;YAC3B,KAAK,EAAE,EAAE;YACT,KAAK,EAAE,EAAE;SACT,CAAC;QACF,MAAM,OAAO,GAA8C;YAC1D,QAAQ,EAAE,KAAK,EAAE,EAAU,EAAE,EAAE;gBAC9B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,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ed under the MIT License.\n */\n\nimport { strict as assert } from \"assert\";\nimport { stringToBuffer } from \"@fluid-internal/client-utils\";\nimport { MockLogger } from \"@fluidframework/telemetry-utils\";\nimport { ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport { ChannelStorageService } from \"../channelStorageService.js\";\n\ndescribe(\"ChannelStorageService\", () => {\n\tit(\"Empty Tree\", async () => {\n\t\tconst tree: ISnapshotTree = {\n\t\t\tblobs: {},\n\t\t\ttrees: {},\n\t\t};\n\t\tconst storage: Pick<IDocumentStorageService, \"readBlob\"> = {\n\t\t\treadBlob: async (id: string) => {\n\t\t\t\tthrow new Error(\"not implemented\");\n\t\t\t},\n\t\t};\n\t\tconst logger = new MockLogger();\n\t\tconst ss = new ChannelStorageService(tree, storage, logger.toTelemetryLogger());\n\n\t\tassert.strictEqual(await ss.contains(\"/\"), false);\n\t\tassert.deepStrictEqual(await ss.list(\"\"), []);\n\t\tlogger.assertMatchNone([{ category: \"error\" }]);\n\t});\n\n\tit(\"Top Level Blob\", async () => {\n\t\tconst tree: ISnapshotTree = {\n\t\t\tblobs: {\n\t\t\t\tfoo: \"bar\",\n\t\t\t},\n\t\t\ttrees: {},\n\t\t};\n\t\tconst storage: Pick<IDocumentStorageService, \"readBlob\"> = {\n\t\t\treadBlob: async (id: string) => {\n\t\t\t\treturn stringToBuffer(id, \"utf8\");\n\t\t\t},\n\t\t};\n\t\tconst logger = new MockLogger();\n\t\tconst ss = new ChannelStorageService(tree, storage, logger.toTelemetryLogger());\n\n\t\tassert.strictEqual(await ss.contains(\"foo\"), true);\n\t\tassert.deepStrictEqual(await ss.list(\"\"), [\"foo\"]);\n\t\tassert.deepStrictEqual(await ss.readBlob(\"foo\"), stringToBuffer(\"bar\", \"utf8\"));\n\t\tlogger.assertMatchNone([{ category: \"error\" }]);\n\t});\n\n\tit(\"Nested Blob\", async () => {\n\t\tconst tree: ISnapshotTree = {\n\t\t\tblobs: {},\n\t\t\ttrees: {\n\t\t\t\tnested: {\n\t\t\t\t\tblobs: {\n\t\t\t\t\t\tfoo: \"bar\",\n\t\t\t\t\t},\n\t\t\t\t\ttrees: {},\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t\tconst storage: Pick<IDocumentStorageService, \"readBlob\"> = {\n\t\t\treadBlob: async (id: string) => {\n\t\t\t\treturn stringToBuffer(id, \"utf8\");\n\t\t\t},\n\t\t};\n\t\tconst logger = new MockLogger();\n\t\tconst ss = new ChannelStorageService(tree, storage, logger.toTelemetryLogger());\n\n\t\tassert.strictEqual(await ss.contains(\"nested/foo\"), true);\n\t\tassert.deepStrictEqual(await ss.list(\"nested/\"), [\"foo\"]);\n\t\tassert.deepStrictEqual(await ss.readBlob(\"nested/foo\"), stringToBuffer(\"bar\", \"utf8\"));\n\t\tlogger.assertMatchNone([{ category: \"error\" }]);\n\t});\n});\n"]}
@@ -0,0 +1,121 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { strict as assert } from "assert";
6
+ import { SummaryType } from "@fluidframework/protocol-definitions";
7
+ import { MockFluidDataStoreContext, validateAssertionError, } from "@fluidframework/test-runtime-utils";
8
+ import { ContainerErrorTypes } from "@fluidframework/container-definitions";
9
+ import { FluidDataStoreRuntime } from "../dataStoreRuntime.js";
10
+ describe("FluidDataStoreRuntime Tests", () => {
11
+ let dataStoreContext;
12
+ let sharedObjectRegistry;
13
+ function createRuntime(context, registry, entrypointInitializationFn) {
14
+ const runtime = new FluidDataStoreRuntime(context, registry,
15
+ /* existing */ false, entrypointInitializationFn ?? (async () => runtime));
16
+ return runtime;
17
+ }
18
+ beforeEach(() => {
19
+ dataStoreContext = new MockFluidDataStoreContext();
20
+ // back-compat 0.38 - DataStoreRuntime looks in container runtime for certain properties that are unavailable
21
+ // in the data store context.
22
+ dataStoreContext.containerRuntime = {};
23
+ sharedObjectRegistry = {
24
+ get(type) {
25
+ return {
26
+ type,
27
+ attributes: { type, snapshotFormatVersion: "0" },
28
+ create: (runtime, id) => ({
29
+ id,
30
+ type,
31
+ attributes: { type, snapshotFormatVersion: "0" },
32
+ clientDetails: {},
33
+ }),
34
+ load: async () => Promise.resolve({}),
35
+ };
36
+ },
37
+ };
38
+ });
39
+ it("constructor rejects ids with forward slashes", () => {
40
+ const invalidId = "beforeSlash/afterSlash";
41
+ dataStoreContext = new MockFluidDataStoreContext(invalidId);
42
+ const codeBlock = () => new FluidDataStoreRuntime(dataStoreContext, sharedObjectRegistry, false, async (dataStoreRuntime) => {
43
+ throw new Error("This shouldn't be called during the test");
44
+ });
45
+ assert.throws(codeBlock, (e) => validateAssertionError(e, "Id cannot contain slashes. DataStoreContext should have validated this."));
46
+ });
47
+ it("can create a data store runtime", () => {
48
+ let failed = false;
49
+ let dataStoreRuntime;
50
+ try {
51
+ dataStoreRuntime = createRuntime(dataStoreContext, sharedObjectRegistry);
52
+ }
53
+ catch (error) {
54
+ failed = true;
55
+ }
56
+ assert.strictEqual(failed, false, "Data store runtime creation failed");
57
+ assert.strictEqual(dataStoreRuntime?.id, dataStoreContext.id, "Data store runtime's id in incorrect");
58
+ });
59
+ it("can summarize an empty data store runtime", async () => {
60
+ const dataStoreRuntime = createRuntime(dataStoreContext, sharedObjectRegistry);
61
+ const summarizeResult = await dataStoreRuntime.summarize(true, false);
62
+ assert(summarizeResult.summary.type === SummaryType.Tree, "Data store runtime did not return a summary tree");
63
+ assert(Object.keys(summarizeResult.summary.tree).length === 0, "The summary should be empty");
64
+ });
65
+ it("can get GC data of an empty data store runtime", async () => {
66
+ // The GC data should have a single node for the data store runtime with empty outbound routes.
67
+ const expectedGCData = {
68
+ gcNodes: { "/": [] },
69
+ };
70
+ const dataStoreRuntime = createRuntime(dataStoreContext, sharedObjectRegistry);
71
+ const gcData = await dataStoreRuntime.getGCData();
72
+ assert.deepStrictEqual(gcData, expectedGCData, "The GC data is incorrect");
73
+ });
74
+ it("createChannel rejects ids with slashes", async () => {
75
+ const dataStoreRuntime = createRuntime(dataStoreContext, sharedObjectRegistry);
76
+ const invalidId = "beforeSlash/afterSlash";
77
+ const codeBlock = () => dataStoreRuntime.createChannel(invalidId, "SomeType");
78
+ assert.throws(codeBlock, (e) => e.errorType === ContainerErrorTypes.usageError &&
79
+ e.message === `Id cannot contain slashes: ${invalidId}`);
80
+ });
81
+ it("createChannel with default guid", async () => {
82
+ const dataStoreRuntime = createRuntime(dataStoreContext, sharedObjectRegistry);
83
+ const type = "SomeType";
84
+ const channel = dataStoreRuntime.createChannel(undefined, type);
85
+ assert(channel !== undefined, "channel should be created");
86
+ assert(type === channel.attributes.type, "type should be as expected");
87
+ });
88
+ it("createChannel and then attach to dataStore runtime", async () => {
89
+ const dataStoreRuntime = createRuntime(dataStoreContext, sharedObjectRegistry);
90
+ const type = "SomeType";
91
+ const channel = {
92
+ id: "id",
93
+ type,
94
+ attributes: { type, snapshotFormatVersion: "0" },
95
+ clientDetails: {},
96
+ };
97
+ dataStoreRuntime.addChannel(channel);
98
+ const channel1 = await dataStoreRuntime.getChannel(channel.id);
99
+ assert.deepStrictEqual(channel, channel1, "both channel should match");
100
+ });
101
+ it("createChannel rejects ids with slashes when channel is created first", async () => {
102
+ const dataStoreRuntime = createRuntime(dataStoreContext, sharedObjectRegistry);
103
+ const invalidId = "beforeSlash/afterSlash";
104
+ const type = "SomeType";
105
+ const channel = {
106
+ id: invalidId,
107
+ type,
108
+ attributes: { type, snapshotFormatVersion: "0" },
109
+ clientDetails: {},
110
+ };
111
+ const codeBlock = () => dataStoreRuntime.addChannel(channel);
112
+ assert.throws(codeBlock, (e) => e.errorType === ContainerErrorTypes.usageError &&
113
+ e.message === `Id cannot contain slashes: ${invalidId}`);
114
+ });
115
+ it("entryPoint is initialized correctly", async () => {
116
+ const myObj = { fakeProp: "fakeValue" };
117
+ const dataStoreRuntime = createRuntime(dataStoreContext, sharedObjectRegistry, async (dsRuntime) => myObj);
118
+ assert((await dataStoreRuntime.entryPoint?.get()) === myObj, "entryPoint was not initialized");
119
+ });
120
+ });
121
+ //# sourceMappingURL=dataStoreRuntime.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataStoreRuntime.spec.js","sourceRoot":"","sources":["../../src/test/dataStoreRuntime.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAMnE,OAAO,EACN,yBAAyB,EACzB,sBAAsB,GACtB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAG5E,OAAO,EAAE,qBAAqB,EAAyB,MAAM,wBAAwB,CAAC;AAEtF,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC5C,IAAI,gBAA2C,CAAC;IAChD,IAAI,oBAA2C,CAAC;IAChD,SAAS,aAAa,CACrB,OAA+B,EAC/B,QAA+B,EAC/B,0BAAiF;QAEjF,MAAM,OAAO,GAA0B,IAAI,qBAAqB,CAC/D,OAAO,EACP,QAAQ;QACR,cAAc,CAAC,KAAK,EACpB,0BAA0B,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,OAAO,CAAC,CACnD,CAAC;QACF,OAAO,OAAO,CAAC;IAChB,CAAC;IAED,UAAU,CAAC,GAAG,EAAE;QACf,gBAAgB,GAAG,IAAI,yBAAyB,EAAE,CAAC;QACnD,6GAA6G;QAC7G,6BAA6B;QAC7B,gBAAgB,CAAC,gBAAgB,GAAG,EAAsC,CAAC;QAC3E,oBAAoB,GAAG;YACtB,GAAG,CAAC,IAAY;gBACf,OAAO;oBACN,IAAI;oBACJ,UAAU,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE,GAAG,EAAE;oBAChD,MAAM,EAAE,CAAC,OAAO,EAAE,EAAU,EAAE,EAAE,CAC/B,CAAC;wBACA,EAAE;wBAC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B,MAAM,OAAO,GAAG;YACf,EAAE,EAAE,SAAS;YACb,IAAI;YACJ,UAAU,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE,GAAG,EAAE;YAChD,aAAa,EAAE,EAAE;SACE,CAAC;QACrB,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,gBAAgB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC7D,MAAM,CAAC,MAAM,CACZ,SAAS,EACT,CAAC,CAAa,EAAE,EAAE,CACjB,CAAC,CAAC,SAAS,KAAK,mBAAmB,CAAC,UAAU;YAC9C,CAAC,CAAC,OAAO,KAAK,8BAA8B,SAAS,EAAE,CACxD,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qCAAqC,EAAE,KAAK,IAAI,EAAE;QACpD,MAAM,KAAK,GAAgB,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;QACrD,MAAM,gBAAgB,GAAG,aAAa,CACrC,gBAAgB,EAChB,oBAAoB,EACpB,KAAK,EAAE,SAAS,EAAE,EAAE,CAAC,KAAK,CAC1B,CAAC;QACF,MAAM,CACL,CAAC,MAAM,gBAAgB,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,KAAK,KAAK,EACpD,gCAAgC,CAChC,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { strict as assert } from \"assert\";\nimport { SummaryType } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIContainerRuntimeBase,\n\tIGarbageCollectionData,\n\tIFluidDataStoreContext,\n} from \"@fluidframework/runtime-definitions\";\nimport {\n\tMockFluidDataStoreContext,\n\tvalidateAssertionError,\n} from \"@fluidframework/test-runtime-utils\";\nimport { ContainerErrorTypes } from \"@fluidframework/container-definitions\";\nimport { IFluidDataStoreRuntime, IChannel } from \"@fluidframework/datastore-definitions\";\nimport { IErrorBase, FluidObject } from \"@fluidframework/core-interfaces\";\nimport { FluidDataStoreRuntime, ISharedObjectRegistry } from \"../dataStoreRuntime.js\";\n\ndescribe(\"FluidDataStoreRuntime Tests\", () => {\n\tlet dataStoreContext: MockFluidDataStoreContext;\n\tlet sharedObjectRegistry: ISharedObjectRegistry;\n\tfunction createRuntime(\n\t\tcontext: IFluidDataStoreContext,\n\t\tregistry: ISharedObjectRegistry,\n\t\tentrypointInitializationFn?: (rt: IFluidDataStoreRuntime) => Promise<FluidObject>,\n\t) {\n\t\tconst runtime: FluidDataStoreRuntime = new FluidDataStoreRuntime(\n\t\t\tcontext,\n\t\t\tregistry,\n\t\t\t/* existing */ false,\n\t\t\tentrypointInitializationFn ?? (async () => runtime),\n\t\t);\n\t\treturn runtime;\n\t}\n\n\tbeforeEach(() => {\n\t\tdataStoreContext = new MockFluidDataStoreContext();\n\t\t// back-compat 0.38 - DataStoreRuntime looks in container runtime for certain properties that are unavailable\n\t\t// in the data store context.\n\t\tdataStoreContext.containerRuntime = {} as unknown as IContainerRuntimeBase;\n\t\tsharedObjectRegistry = {\n\t\t\tget(type: string) {\n\t\t\t\treturn {\n\t\t\t\t\ttype,\n\t\t\t\t\tattributes: { type, snapshotFormatVersion: \"0\" },\n\t\t\t\t\tcreate: (runtime, id: string) =>\n\t\t\t\t\t\t({\n\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\tattributes: { type, snapshotFormatVersion: \"0\" },\n\t\t\t\t\t\t\tclientDetails: {},\n\t\t\t\t\t\t}) as any as IChannel,\n\t\t\t\t\tload: async () => Promise.resolve({} as any as IChannel),\n\t\t\t\t};\n\t\t\t},\n\t\t};\n\t});\n\n\tit(\"constructor rejects ids with forward slashes\", () => {\n\t\tconst invalidId = \"beforeSlash/afterSlash\";\n\t\tdataStoreContext = new MockFluidDataStoreContext(invalidId);\n\t\tconst codeBlock = () =>\n\t\t\tnew FluidDataStoreRuntime(\n\t\t\t\tdataStoreContext,\n\t\t\t\tsharedObjectRegistry,\n\t\t\t\tfalse,\n\t\t\t\tasync (dataStoreRuntime) => {\n\t\t\t\t\tthrow new Error(\"This shouldn't be called during the test\");\n\t\t\t\t},\n\t\t\t);\n\t\tassert.throws(codeBlock, (e: Error) =>\n\t\t\tvalidateAssertionError(\n\t\t\t\te,\n\t\t\t\t\"Id cannot contain slashes. DataStoreContext should have validated this.\",\n\t\t\t),\n\t\t);\n\t});\n\n\tit(\"can create a data store runtime\", () => {\n\t\tlet failed: boolean = false;\n\t\tlet dataStoreRuntime: FluidDataStoreRuntime | undefined;\n\t\ttry {\n\t\t\tdataStoreRuntime = createRuntime(dataStoreContext, sharedObjectRegistry);\n\t\t} catch (error) {\n\t\t\tfailed = true;\n\t\t}\n\t\tassert.strictEqual(failed, false, \"Data store runtime creation failed\");\n\t\tassert.strictEqual(\n\t\t\tdataStoreRuntime?.id,\n\t\t\tdataStoreContext.id,\n\t\t\t\"Data store runtime's id in incorrect\",\n\t\t);\n\t});\n\n\tit(\"can summarize an empty data store runtime\", async () => {\n\t\tconst dataStoreRuntime = createRuntime(dataStoreContext, sharedObjectRegistry);\n\t\tconst summarizeResult = await dataStoreRuntime.summarize(true, false);\n\t\tassert(\n\t\t\tsummarizeResult.summary.type === SummaryType.Tree,\n\t\t\t\"Data store runtime did not return a summary tree\",\n\t\t);\n\t\tassert(\n\t\t\tObject.keys(summarizeResult.summary.tree).length === 0,\n\t\t\t\"The summary should be empty\",\n\t\t);\n\t});\n\n\tit(\"can get GC data of an empty data store runtime\", async () => {\n\t\t// The GC data should have a single node for the data store runtime with empty outbound routes.\n\t\tconst expectedGCData: IGarbageCollectionData = {\n\t\t\tgcNodes: { \"/\": [] },\n\t\t};\n\t\tconst dataStoreRuntime = createRuntime(dataStoreContext, sharedObjectRegistry);\n\t\tconst gcData = await dataStoreRuntime.getGCData();\n\t\tassert.deepStrictEqual(gcData, expectedGCData, \"The GC data is incorrect\");\n\t});\n\n\tit(\"createChannel rejects ids with slashes\", async () => {\n\t\tconst dataStoreRuntime = createRuntime(dataStoreContext, sharedObjectRegistry);\n\t\tconst invalidId = \"beforeSlash/afterSlash\";\n\t\tconst codeBlock = () => dataStoreRuntime.createChannel(invalidId, \"SomeType\");\n\t\tassert.throws(\n\t\t\tcodeBlock,\n\t\t\t(e: IErrorBase) =>\n\t\t\t\te.errorType === ContainerErrorTypes.usageError &&\n\t\t\t\te.message === `Id cannot contain slashes: ${invalidId}`,\n\t\t);\n\t});\n\n\tit(\"createChannel with default guid\", async () => {\n\t\tconst dataStoreRuntime = createRuntime(dataStoreContext, sharedObjectRegistry);\n\t\tconst type = \"SomeType\";\n\t\tconst channel = dataStoreRuntime.createChannel(undefined, type);\n\t\tassert(channel !== undefined, \"channel should be created\");\n\t\tassert(type === channel.attributes.type, \"type should be as expected\");\n\t});\n\n\tit(\"createChannel and then attach to dataStore runtime\", async () => {\n\t\tconst dataStoreRuntime = createRuntime(dataStoreContext, sharedObjectRegistry);\n\t\tconst type = \"SomeType\";\n\t\tconst channel = {\n\t\t\tid: \"id\",\n\t\t\ttype,\n\t\t\tattributes: { type, snapshotFormatVersion: \"0\" },\n\t\t\tclientDetails: {},\n\t\t} as any as IChannel;\n\t\tdataStoreRuntime.addChannel(channel);\n\t\tconst channel1 = await dataStoreRuntime.getChannel(channel.id);\n\t\tassert.deepStrictEqual(channel, channel1, \"both channel should match\");\n\t});\n\n\tit(\"createChannel rejects ids with slashes when channel is created first\", async () => {\n\t\tconst dataStoreRuntime = createRuntime(dataStoreContext, sharedObjectRegistry);\n\t\tconst invalidId = \"beforeSlash/afterSlash\";\n\t\tconst type = \"SomeType\";\n\t\tconst channel = {\n\t\t\tid: invalidId,\n\t\t\ttype,\n\t\t\tattributes: { type, snapshotFormatVersion: \"0\" },\n\t\t\tclientDetails: {},\n\t\t} as any as IChannel;\n\t\tconst codeBlock = () => dataStoreRuntime.addChannel(channel);\n\t\tassert.throws(\n\t\t\tcodeBlock,\n\t\t\t(e: IErrorBase) =>\n\t\t\t\te.errorType === ContainerErrorTypes.usageError &&\n\t\t\t\te.message === `Id cannot contain slashes: ${invalidId}`,\n\t\t);\n\t});\n\n\tit(\"entryPoint is initialized correctly\", async () => {\n\t\tconst myObj: FluidObject = { fakeProp: \"fakeValue\" };\n\t\tconst dataStoreRuntime = createRuntime(\n\t\t\tdataStoreContext,\n\t\t\tsharedObjectRegistry,\n\t\t\tasync (dsRuntime) => myObj,\n\t\t);\n\t\tassert(\n\t\t\t(await dataStoreRuntime.entryPoint?.get()) === myObj,\n\t\t\t\"entryPoint was not initialized\",\n\t\t);\n\t});\n});\n"]}
@@ -0,0 +1,41 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { strict as assert } from "assert";
6
+ import { MockFluidDataStoreContext, validateAssertionError, } from "@fluidframework/test-runtime-utils";
7
+ import { FluidDataStoreRuntime } from "../dataStoreRuntime.js";
8
+ import { LocalChannelContext, RehydratedLocalChannelContext } from "../localChannelContext.js";
9
+ describe("LocalChannelContext Tests", () => {
10
+ let dataStoreContext;
11
+ let sharedObjectRegistry;
12
+ const loadRuntime = (context, registry) => new FluidDataStoreRuntime(context, registry, /* existing */ false, async () => ({
13
+ myProp: "myValue",
14
+ }));
15
+ beforeEach(() => {
16
+ dataStoreContext = new MockFluidDataStoreContext();
17
+ sharedObjectRegistry = {
18
+ get(type) {
19
+ return {
20
+ type,
21
+ attributes: { type, snapshotFormatVersion: "0" },
22
+ create: () => ({}),
23
+ load: async () => Promise.resolve({}),
24
+ };
25
+ },
26
+ };
27
+ });
28
+ it("LocalChannelContext rejects ids with forward slashes", () => {
29
+ const invalidId = "beforeSlash/afterSlash";
30
+ const dataStoreRuntime = loadRuntime(dataStoreContext, sharedObjectRegistry);
31
+ const codeBlock = () => new LocalChannelContext({ id: invalidId }, dataStoreRuntime, dataStoreContext, dataStoreContext.storage, dataStoreContext.logger, () => { }, (s) => { }, (s) => { });
32
+ assert.throws(codeBlock, (e) => validateAssertionError(e, "Channel context ID cannot contain slashes"), "Expected exception was not thrown");
33
+ });
34
+ it("RehydratedLocalChannelContext rejects ids with forward slashes", () => {
35
+ const invalidId = "beforeSlash/afterSlash";
36
+ const dataStoreRuntime = loadRuntime(dataStoreContext, sharedObjectRegistry);
37
+ const codeBlock = () => new RehydratedLocalChannelContext(invalidId, sharedObjectRegistry, dataStoreRuntime, dataStoreContext, dataStoreContext.storage, dataStoreContext.logger, (content, localOpMetadata) => { }, (s) => { }, (s, o) => { }, null);
38
+ assert.throws(codeBlock, (e) => validateAssertionError(e, "Channel context ID cannot contain slashes"), "Expected exception was not thrown");
39
+ });
40
+ });
41
+ //# sourceMappingURL=localChannelContext.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"localChannelContext.spec.js","sourceRoot":"","sources":["../../src/test/localChannelContext.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE1C,OAAO,EACN,yBAAyB,EACzB,sBAAsB,GACtB,MAAM,oCAAoC,CAAC;AAG5C,OAAO,EAAE,qBAAqB,EAAyB,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAE/F,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IAC1C,IAAI,gBAA2C,CAAC;IAChD,IAAI,oBAA2C,CAAC;IAChD,MAAM,WAAW,GAAG,CAAC,OAA+B,EAAE,QAA+B,EAAE,EAAE,CACxF,IAAI,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAE,cAAc,CAAC,KAAK,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QAC/E,MAAM,EAAE,SAAS;KACjB,CAAC,CAAC,CAAC;IAEL,UAAU,CAAC,GAAG,EAAE;QACf,gBAAgB,GAAG,IAAI,yBAAyB,EAAE,CAAC;QACnD,oBAAoB,G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B,gBAAgB,CAAC,MAAM,EACvB,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,GAAE,CAAC,EAChC,CAAC,CAAS,EAAE,EAAE,GAAE,CAAC,EACjB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,GAAE,CAAC,EACZ,IAAgC,CAChC,CAAC;QACH,MAAM,CAAC,MAAM,CACZ,SAAS,EACT,CAAC,CAAQ,EAAE,EAAE,CAAC,sBAAsB,CAAC,CAAC,EAAE,2CAA2C,CAAC,EACpF,mCAAmC,CACnC,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { strict as assert } from \"assert\";\nimport { IFluidDataStoreContext } from \"@fluidframework/runtime-definitions\";\nimport {\n\tMockFluidDataStoreContext,\n\tvalidateAssertionError,\n} from \"@fluidframework/test-runtime-utils\";\nimport { ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport { IChannel } from \"@fluidframework/datastore-definitions\";\nimport { FluidDataStoreRuntime, ISharedObjectRegistry } from \"../dataStoreRuntime.js\";\nimport { LocalChannelContext, RehydratedLocalChannelContext } from \"../localChannelContext.js\";\n\ndescribe(\"LocalChannelContext Tests\", () => {\n\tlet dataStoreContext: MockFluidDataStoreContext;\n\tlet sharedObjectRegistry: ISharedObjectRegistry;\n\tconst loadRuntime = (context: IFluidDataStoreContext, registry: ISharedObjectRegistry) =>\n\t\tnew FluidDataStoreRuntime(context, registry, /* existing */ false, async () => ({\n\t\t\tmyProp: \"myValue\",\n\t\t}));\n\n\tbeforeEach(() => {\n\t\tdataStoreContext = new MockFluidDataStoreContext();\n\t\tsharedObjectRegistry = {\n\t\t\tget(type: string) {\n\t\t\t\treturn {\n\t\t\t\t\ttype,\n\t\t\t\t\tattributes: { type, snapshotFormatVersion: \"0\" },\n\t\t\t\t\tcreate: () => ({}) as any as IChannel,\n\t\t\t\t\tload: async () => Promise.resolve({} as any as IChannel),\n\t\t\t\t};\n\t\t\t},\n\t\t};\n\t});\n\n\tit(\"LocalChannelContext rejects ids with forward slashes\", () => {\n\t\tconst invalidId = \"beforeSlash/afterSlash\";\n\t\tconst dataStoreRuntime = loadRuntime(dataStoreContext, sharedObjectRegistry);\n\t\tconst codeBlock = () =>\n\t\t\tnew LocalChannelContext(\n\t\t\t\t{ id: invalidId } as any as IChannel,\n\t\t\t\tdataStoreRuntime,\n\t\t\t\tdataStoreContext,\n\t\t\t\tdataStoreContext.storage,\n\t\t\t\tdataStoreContext.logger,\n\t\t\t\t() => {},\n\t\t\t\t(s: string) => {},\n\t\t\t\t(s) => {},\n\t\t\t);\n\t\tassert.throws(\n\t\t\tcodeBlock,\n\t\t\t(e: Error) => validateAssertionError(e, \"Channel context ID cannot contain slashes\"),\n\t\t\t\"Expected exception was not thrown\",\n\t\t);\n\t});\n\n\tit(\"RehydratedLocalChannelContext rejects ids with forward slashes\", () => {\n\t\tconst invalidId = \"beforeSlash/afterSlash\";\n\t\tconst dataStoreRuntime = loadRuntime(dataStoreContext, sharedObjectRegistry);\n\t\tconst codeBlock = () =>\n\t\t\tnew RehydratedLocalChannelContext(\n\t\t\t\tinvalidId,\n\t\t\t\tsharedObjectRegistry,\n\t\t\t\tdataStoreRuntime,\n\t\t\t\tdataStoreContext,\n\t\t\t\tdataStoreContext.storage,\n\t\t\t\tdataStoreContext.logger,\n\t\t\t\t(content, localOpMetadata) => {},\n\t\t\t\t(s: string) => {},\n\t\t\t\t(s, o) => {},\n\t\t\t\tnull as unknown as ISnapshotTree,\n\t\t\t);\n\t\tassert.throws(\n\t\t\tcodeBlock,\n\t\t\t(e: Error) => validateAssertionError(e, \"Channel context ID cannot contain slashes\"),\n\t\t\t\"Expected exception was not thrown\",\n\t\t);\n\t});\n});\n"]}
@@ -0,0 +1,72 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { strict as assert } from "assert";
6
+ import { stringToBuffer } from "@fluid-internal/client-utils";
7
+ import { FileMode, TreeEntry } from "@fluidframework/protocol-definitions";
8
+ import { LocalChannelStorageService } from "../localChannelStorageService.js";
9
+ describe("LocalChannelStorageService", () => {
10
+ it("Empty Tree", async () => {
11
+ const tree = {
12
+ entries: [],
13
+ };
14
+ const ss = new LocalChannelStorageService(tree);
15
+ assert.strictEqual(await ss.contains("/"), false);
16
+ assert.deepStrictEqual(await ss.list(""), []);
17
+ try {
18
+ await ss.readBlob("test");
19
+ }
20
+ catch (error) {
21
+ assert.strictEqual(error.message, "Blob Not Found");
22
+ }
23
+ });
24
+ it("Top Level Blob", async () => {
25
+ const tree = {
26
+ entries: [
27
+ {
28
+ mode: FileMode.File,
29
+ path: "foo",
30
+ type: TreeEntry.Blob,
31
+ value: {
32
+ encoding: "utf-8",
33
+ contents: "bar",
34
+ },
35
+ },
36
+ ],
37
+ };
38
+ const ss = new LocalChannelStorageService(tree);
39
+ assert.strictEqual(await ss.contains("foo"), true);
40
+ assert.deepStrictEqual(await ss.list(""), ["foo"]);
41
+ assert.deepStrictEqual(await ss.readBlob("foo"), stringToBuffer("bar", "utf8"));
42
+ });
43
+ it("Nested Blob", async () => {
44
+ const tree = {
45
+ entries: [
46
+ {
47
+ mode: FileMode.File,
48
+ path: "nested",
49
+ type: TreeEntry.Tree,
50
+ value: {
51
+ entries: [
52
+ {
53
+ mode: FileMode.File,
54
+ path: "foo",
55
+ type: TreeEntry.Blob,
56
+ value: {
57
+ encoding: "utf-8",
58
+ contents: "bar",
59
+ },
60
+ },
61
+ ],
62
+ },
63
+ },
64
+ ],
65
+ };
66
+ const ss = new LocalChannelStorageService(tree);
67
+ assert.strictEqual(await ss.contains("nested/foo"), true);
68
+ assert.deepStrictEqual(await ss.list("nested/"), ["foo"]);
69
+ assert.deepStrictEqual(await ss.readBlob("nested/foo"), stringToBuffer("bar", "utf8"));
70
+ });
71
+ });
72
+ //# sourceMappingURL=localChannelStorageService.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"localChannelStorageService.spec.js","sourceRoot":"","sources":["../../src/test/localChannelStorageService.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAS,QAAQ,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAE9E,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC3C,EAAE,CAAC,YAAY,EAAE,KAAK,IAAI,EAAE;QAC3B,MAAM,IAAI,GAAU;YACnB,OAAO,EAAE,EAAE;SACX,CAAC;QAEF,MAAM,EAAE,GAAG,IAAI,0BAA0B,CAAC,IAAI,CAAC,CAAC;QAEhD,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;QAClD,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAC9C,IAAI;YACH,MAAM,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;SAC1B;QAAC,OAAO,KAAU,EAAE;YACpB,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;SACpD;IACF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gBAAgB,EAAE,KAAK,IAAI,EAAE;QAC/B,MAAM,IAAI,GAAU;YACnB,OAAO,EAAE;gBACR;oBACC,IAAI,EAAE,QAAQ,CAAC,IAAI;oBACnB,IAAI,EAAE,KAAK;oBACX,IAAI,EAAE,SAAS,CAAC,IAAI;oBACpB,KAAK,EAAE;wBACN,QAAQ,EAAE,OAAO;wBACjB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EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IACxF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { strict as assert } from \"assert\";\nimport { stringToBuffer } from \"@fluid-internal/client-utils\";\nimport { ITree, FileMode, TreeEntry } from \"@fluidframework/protocol-definitions\";\nimport { LocalChannelStorageService } from \"../localChannelStorageService.js\";\n\ndescribe(\"LocalChannelStorageService\", () => {\n\tit(\"Empty Tree\", async () => {\n\t\tconst tree: ITree = {\n\t\t\tentries: [],\n\t\t};\n\n\t\tconst ss = new LocalChannelStorageService(tree);\n\n\t\tassert.strictEqual(await ss.contains(\"/\"), false);\n\t\tassert.deepStrictEqual(await ss.list(\"\"), []);\n\t\ttry {\n\t\t\tawait ss.readBlob(\"test\");\n\t\t} catch (error: any) {\n\t\t\tassert.strictEqual(error.message, \"Blob Not Found\");\n\t\t}\n\t});\n\n\tit(\"Top Level Blob\", async () => {\n\t\tconst tree: ITree = {\n\t\t\tentries: [\n\t\t\t\t{\n\t\t\t\t\tmode: FileMode.File,\n\t\t\t\t\tpath: \"foo\",\n\t\t\t\t\ttype: TreeEntry.Blob,\n\t\t\t\t\tvalue: {\n\t\t\t\t\t\tencoding: \"utf-8\",\n\t\t\t\t\t\tcontents: \"bar\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\n\t\tconst ss = new LocalChannelStorageService(tree);\n\n\t\tassert.strictEqual(await ss.contains(\"foo\"), true);\n\t\tassert.deepStrictEqual(await ss.list(\"\"), [\"foo\"]);\n\t\tassert.deepStrictEqual(await ss.readBlob(\"foo\"), stringToBuffer(\"bar\", \"utf8\"));\n\t});\n\n\tit(\"Nested Blob\", async () => {\n\t\tconst tree: ITree = {\n\t\t\tentries: [\n\t\t\t\t{\n\t\t\t\t\tmode: FileMode.File,\n\t\t\t\t\tpath: \"nested\",\n\t\t\t\t\ttype: TreeEntry.Tree,\n\t\t\t\t\tvalue: {\n\t\t\t\t\t\tentries: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmode: FileMode.File,\n\t\t\t\t\t\t\t\tpath: \"foo\",\n\t\t\t\t\t\t\t\ttype: TreeEntry.Blob,\n\t\t\t\t\t\t\t\tvalue: {\n\t\t\t\t\t\t\t\t\tencoding: \"utf-8\",\n\t\t\t\t\t\t\t\t\tcontents: \"bar\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\t\tconst ss = new LocalChannelStorageService(tree);\n\n\t\tassert.strictEqual(await ss.contains(\"nested/foo\"), true);\n\t\tassert.deepStrictEqual(await ss.list(\"nested/\"), [\"foo\"]);\n\t\tassert.deepStrictEqual(await ss.readBlob(\"nested/foo\"), stringToBuffer(\"bar\", \"utf8\"));\n\t});\n});\n"]}
@@ -0,0 +1,33 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { strict as assert } from "assert";
6
+ import { MockFluidDataStoreContext, validateAssertionError, } from "@fluidframework/test-runtime-utils";
7
+ import { FluidDataStoreRuntime } from "../dataStoreRuntime.js";
8
+ import { RemoteChannelContext } from "../remoteChannelContext.js";
9
+ describe("RemoteChannelContext Tests", () => {
10
+ let dataStoreContext;
11
+ let sharedObjectRegistry;
12
+ const loadRuntime = (context, registry) => new FluidDataStoreRuntime(context, registry, /* existing */ false, async () => ({
13
+ myProp: "myValue",
14
+ }));
15
+ beforeEach(() => {
16
+ dataStoreContext = new MockFluidDataStoreContext();
17
+ // back-compat 0.38 - DataStoreRuntime looks in container runtime for certain properties that are unavailable
18
+ // in the data store context.
19
+ dataStoreContext.containerRuntime = {};
20
+ sharedObjectRegistry = {
21
+ get(name) {
22
+ throw new Error("Not implemented");
23
+ },
24
+ };
25
+ });
26
+ it("rejects ids with forward slashes", () => {
27
+ const invalidId = "beforeSlash/afterSlash";
28
+ const dataStoreRuntime = loadRuntime(dataStoreContext, sharedObjectRegistry);
29
+ const codeBlock = () => new RemoteChannelContext(dataStoreRuntime, dataStoreContext, dataStoreContext.storage, (c, lom) => { }, (s) => { }, (s, o) => { }, invalidId, undefined, sharedObjectRegistry, undefined, undefined, "SomeAttachMessageType");
30
+ assert.throws(codeBlock, (e) => validateAssertionError(e, "Channel context ID cannot contain slashes"), "Expected exception was not thrown");
31
+ });
32
+ });
33
+ //# sourceMappingURL=remoteChannelContext.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remoteChannelContext.spec.js","sourceRoot":"","sources":["../../src/test/remoteChannelContext.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,QAAQ,CAAC;AAM1C,OAAO,EACN,yBAAyB,EACzB,sBAAsB,GACtB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,qBAAqB,EAAyB,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC3C,IAAI,gBAA2C,CAAC;IAChD,IAAI,oBAA2C,CAAC;IAChD,MAAM,WAAW,GAAG,CAAC,OAA+B,EAAE,QAA+B,EAAE,EAAE,CACxF,IAAI,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAE,cAAc,CAAC,KAAK,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QAC/E,MAAM,EAAE,SAAS;KACjB,CAAC,CAAC,CAAC;IAEL,UAAU,CAAC,GAAG,EAAE;QACf,gBAAgB,GAAG,IAAI,yBAAyB,EAAE,CAAC;QACnD,6GAA6G;QAC7G,6BAA6B;QAC7B,gBAAgB,CAAC,gBAAgB,GAAG,EAAsC,CAAC;QAC3E,oBAAoB,GAAG;YACtB,GAAG,CAAC,IAAY;gBACf,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;YACpC,CAAC;SACD,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;QAC3C,MAAM,SAAS,GAAG,wBAAwB,CAAC;QAC3C,MAAM,gBAAgB,GAAG,WAAW,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,CAAC;QAC7E,MAAM,SAAS,GAAG,GAAG,EAAE,CACtB,IAAI,oBAAoB,CACvB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,CAAC,OAAO,EACxB,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,GAAE,CAAC,EACd,CAAC,CAAS,EAAE,EAAE,GAAE,CAAC,EACjB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,GAAE,CAAC,EACZ,SAAS,EACT,SAAqC,EACrC,oBAAoB,EACpB,SAAS,EACT,SAAmD,EACnD,uBAAuB,CACvB,CAAC;QACH,MAAM,CAAC,MAAM,CACZ,SAAS,EACT,CAAC,CAAQ,EAAE,EAAE,CAAC,sBAAsB,CAAC,CAAC,EAAE,2CAA2C,CAAC,EACpF,mCAAmC,CACnC,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { strict as assert } from \"assert\";\nimport {\n\tCreateChildSummarizerNodeFn,\n\tIContainerRuntimeBase,\n\tIFluidDataStoreContext,\n} from \"@fluidframework/runtime-definitions\";\nimport {\n\tMockFluidDataStoreContext,\n\tvalidateAssertionError,\n} from \"@fluidframework/test-runtime-utils\";\nimport { ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport { FluidDataStoreRuntime, ISharedObjectRegistry } from \"../dataStoreRuntime.js\";\nimport { RemoteChannelContext } from \"../remoteChannelContext.js\";\n\ndescribe(\"RemoteChannelContext Tests\", () => {\n\tlet dataStoreContext: MockFluidDataStoreContext;\n\tlet sharedObjectRegistry: ISharedObjectRegistry;\n\tconst loadRuntime = (context: IFluidDataStoreContext, registry: ISharedObjectRegistry) =>\n\t\tnew FluidDataStoreRuntime(context, registry, /* existing */ false, async () => ({\n\t\t\tmyProp: \"myValue\",\n\t\t}));\n\n\tbeforeEach(() => {\n\t\tdataStoreContext = new MockFluidDataStoreContext();\n\t\t// back-compat 0.38 - DataStoreRuntime looks in container runtime for certain properties that are unavailable\n\t\t// in the data store context.\n\t\tdataStoreContext.containerRuntime = {} as unknown as IContainerRuntimeBase;\n\t\tsharedObjectRegistry = {\n\t\t\tget(name: string) {\n\t\t\t\tthrow new Error(\"Not implemented\");\n\t\t\t},\n\t\t};\n\t});\n\n\tit(\"rejects ids with forward slashes\", () => {\n\t\tconst invalidId = \"beforeSlash/afterSlash\";\n\t\tconst dataStoreRuntime = loadRuntime(dataStoreContext, sharedObjectRegistry);\n\t\tconst codeBlock = () =>\n\t\t\tnew RemoteChannelContext(\n\t\t\t\tdataStoreRuntime,\n\t\t\t\tdataStoreContext,\n\t\t\t\tdataStoreContext.storage,\n\t\t\t\t(c, lom) => {},\n\t\t\t\t(s: string) => {},\n\t\t\t\t(s, o) => {},\n\t\t\t\tinvalidId,\n\t\t\t\tundefined as unknown as ISnapshotTree,\n\t\t\t\tsharedObjectRegistry,\n\t\t\t\tundefined,\n\t\t\t\tundefined as unknown as CreateChildSummarizerNodeFn,\n\t\t\t\t\"SomeAttachMessageType\",\n\t\t\t);\n\t\tassert.throws(\n\t\t\tcodeBlock,\n\t\t\t(e: Error) => validateAssertionError(e, \"Channel context ID cannot contain slashes\"),\n\t\t\t\"Expected exception was not thrown\",\n\t\t);\n\t});\n});\n"]}
@@ -0,0 +1,16 @@
1
+ use_current_EnumDeclaration_DataStoreMessageType(get_old_EnumDeclaration_DataStoreMessageType());
2
+ use_old_EnumDeclaration_DataStoreMessageType(get_current_EnumDeclaration_DataStoreMessageType());
3
+ use_current_ClassDeclaration_FluidDataStoreRuntime(
4
+ // @ts-expect-error compatibility expected to be broken
5
+ get_old_ClassDeclaration_FluidDataStoreRuntime());
6
+ use_old_ClassDeclaration_FluidDataStoreRuntime(get_current_ClassDeclaration_FluidDataStoreRuntime());
7
+ use_current_ClassDeclaration_FluidObjectHandle(get_old_ClassDeclaration_FluidObjectHandle());
8
+ use_old_ClassDeclaration_FluidObjectHandle(get_current_ClassDeclaration_FluidObjectHandle());
9
+ use_current_InterfaceDeclaration_ISharedObjectRegistry(get_old_InterfaceDeclaration_ISharedObjectRegistry());
10
+ use_old_InterfaceDeclaration_ISharedObjectRegistry(get_current_InterfaceDeclaration_ISharedObjectRegistry());
11
+ use_current_VariableDeclaration_mixinRequestHandler(get_old_VariableDeclaration_mixinRequestHandler());
12
+ use_old_VariableDeclaration_mixinRequestHandler(get_current_VariableDeclaration_mixinRequestHandler());
13
+ use_current_VariableDeclaration_mixinSummaryHandler(get_old_VariableDeclaration_mixinSummaryHandler());
14
+ use_old_VariableDeclaration_mixinSummaryHandler(get_current_VariableDeclaration_mixinSummaryHandler());
15
+ export {};
16
+ //# sourceMappingURL=validateDatastorePrevious.generated.js.map