FluidFramework icon indicating copy to clipboard operation
FluidFramework copied to clipboard

Fix bug for No context for Op

Open jatgarg opened this issue 1 year ago • 4 comments

Breaking Changes

ADO item link

The issue was that we were encoding the ids of datastores/ddses when uploading the summary while on the snapshot download path for binary snapshot we were decoding them. Previously, when we were not using short ids, the encoded ids were same as original ids as they did not contain special characters, so we never faced this issue before. With the usage of short ids, we discovered this long-hidden bug for ODSP. Also, enabled the e2e tests which were written to reproduce the scenario.

jatgarg avatar Jun 27 '24 21:06 jatgarg

I noticed that data store path is encoded here as well - https://github.com/microsoft/FluidFramework/blob/234f661fd77b997f44298e423fb932a9081fd1d9/packages/drivers/odsp-driver/src/odspFluidFileLink.ts#L34.

From what I can tell, this is used by apps to create a sharing link and encoding here would also result in a bug if not decoded properly.

agarwal-navin avatar Jun 27 '24 21:06 agarwal-navin

I noticed that data store path is encoded here as well -

https://github.com/microsoft/FluidFramework/blob/234f661fd77b997f44298e423fb932a9081fd1d9/packages/drivers/odsp-driver/src/odspFluidFileLink.ts#L34

. From what I can tell, this is used by apps to create a sharing link and encoding here would also result in a bug if not decoded properly.

@jatgarg - please look for all the cases where we do encoding / decoding in the driver. This looks orthogonal to how we store data in storage, but from what I gather, there should be a matching decoding in decodeOdspFluidDataStoreLocator() which is missing. And given (if I got it right) this path theoretically could have forward slashes (even today, or in future with nested data stores), I think it has to encode/decode.

vladsud avatar Jun 27 '24 22:06 vladsud

BTW, createOdspUrl() seems to be matching to decodeOdspUrl() (path variable) correctly - we encode and decode dataStorePath fine

vladsud avatar Jun 27 '24 22:06 vladsud

@fluid-example/bundle-size-tests: +201 Bytes
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 454.56 KB 454.6 KB +35 Bytes
azureClient.js 552.16 KB 552.21 KB +49 Bytes
connectionState.js 680 Bytes 680 Bytes No change
containerRuntime.js 255.87 KB 255.88 KB +14 Bytes
fluidFramework.js 384.95 KB 384.97 KB +14 Bytes
loader.js 134.01 KB 134.03 KB +14 Bytes
map.js 42.17 KB 42.17 KB +7 Bytes
matrix.js 145.44 KB 145.45 KB +7 Bytes
odspClient.js 519.99 KB 520 KB +9 Bytes
odspDriver.js 96.98 KB 96.96 KB -19 Bytes
odspPrefetchSnapshot.js 42.27 KB 42.24 KB -26 Bytes
sharedString.js 162.52 KB 162.53 KB +7 Bytes
sharedTree.js 375.42 KB 375.42 KB +7 Bytes
Total Size 3.24 MB 3.24 MB +201 Bytes

Baseline commit: 0206dd09909d7674d9168a8532dff7b09c065ea7

Generated by :no_entry_sign: dangerJS against 1648795efa5e509c273f098530f767f32707cdc1

msfluid-bot avatar Jun 28 '24 04:06 msfluid-bot