FluidFramework icon indicating copy to clipboard operation
FluidFramework copied to clipboard

tree: Add root invalidation and schema errors to API

Open CraigMacomber opened this issue 1 year ago • 4 comments

Description

Add root invalidation and schema compatibility errors to API. Also adds explicit schema upgrading.

This makes it possible for apps to recover from schema errors (even if it happens after the document was already open due to schema editing) such that apps can inform the user and optionally allow them to upgrade the document if possible and desired.

Reviewer Guidance

The review process is outlined on this wiki page.

This is an API proposal. If approved, an implementation and use (in inventory-app) will be added to this PR.

CraigMacomber avatar Jan 11 '24 19:01 CraigMacomber

I don't think API council has sufficient context to give meaningful/useful feedback here, if you want that. Do you have a pointer to a problem statement, and an overall design document for schema upgrades, so we can understand how these specific changes fit in?

The TODOs which are being removed are effectively the problem statement here, but I'll provide a more explicit one below:

It is currently impossible for an application to recover from and expose to the user schema compatibility issues occurring from opening incompatible document. It is also currently impossible for an app to correctly handle a document that is currently open becoming incompatible. This means instead of allowing the app to display an error to the user and/or possibly allowing them to take some action, unspecified behavior occurs, possibly resulting in data corruption.

This PR adds APIs solving these problems as noted in the PR description:

This makes it possible for apps to recover from schema errors (even if it happens after the document was already open due to schema editing) such that apps can inform the user and optionally allow them to upgrade the document if possible and desired.

CraigMacomber avatar Jan 22 '24 18:01 CraigMacomber

This is now a draft as the implementation to support the approved API is a work in progress.

CraigMacomber avatar Jan 24 '24 00:01 CraigMacomber

This needs some dedicated tests for the new code, and possibly pulling some unrelated changes out into their own PRs. Also needs some more manual testing of the example.

Otherwise, this should be fully functional.

CraigMacomber avatar Feb 02 '24 20:02 CraigMacomber

@fluid-example/bundle-size-tests: +1.34 KB
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 514.17 KB 514.2 KB +33 Bytes
connectionState.js 680 Bytes 680 Bytes No change
containerRuntime.js 247.99 KB 248 KB +11 Bytes
loader.js 171.31 KB 171.31 KB No change
map.js 46.69 KB 46.7 KB +11 Bytes
matrix.js 148.74 KB 148.74 KB No change
odspDriver.js 97.36 KB 97.37 KB +11 Bytes
odspPrefetchSnapshot.js 42.28 KB 42.29 KB +11 Bytes
sharedString.js 167.32 KB 167.33 KB +11 Bytes
sharedTree.js 334.63 KB 335.89 KB +1.26 KB
Total Size 1.87 MB 1.87 MB +1.34 KB

Baseline commit: 6dea0208f640bb906ee66db9a50879c53587a1ea

Generated by :no_entry_sign: dangerJS against d335323d7282bb63b58063c03d730e9bffe54ef7

msfluid-bot avatar Feb 02 '24 21:02 msfluid-bot