Comments (6)
Here are the options we've considered so far:
- Adding an encoding field to ISummaryTree/ISummaryBlob.
- Changing the document creation endpoint to use whole document summaries.
- Using an empty initial document on creation (like ODSP).
Option 1: ISummaryBlob.encoding
The smallest change would be to add an optional encoding field to ISummaryBlob to differentiate between a utf-8 encoded string and a base64 encoded Uint8Array.
However, the root cause of this bug is arguably that it is incorrect to uses ISummaryTree as a wire format. When support for Uint8Array blobs was introduced, ISummaryTree began requiring an encoding step prior to serialization. It is dubious that encoding an ISummaryTree yields an ISummaryTree (see convertSummaryToCreateNewSummary).
The technically correct fix is to use distinct formats for decoded summaries and encoded summaries, which brings us to the next option:
Option 2: IWholeSummaryTree
FRS's historian endpoint already uses a distinct format for encoded summaries, which does correctly preserve encodings (see convertSummaryTreeToWholeSummaryTree). Ideally, we would use the same format for document creation as well. This however is likely to be nuanced and requires more design/investigation.
One reason is that the driver and Historian/GitRest services originally communicated via GitHub's public REST API. This made it possible to use GitHub as a storage service (either directly or via Historian) using the "shredded" summary protocol. To improve efficiency, FRS later introduced the "whole" summary protocol, which extends the GitHub public REST API with the new '/summaries/' route for bulk operations (see 'enableWholeSummaryUpload').
A potential complication of adopting IWholeSummaryTree everywhere is that Tinylicious and the default configuration of Routerlicious continue to use shredded summaries. Research is needed to understand if these would also need to be converted to use whole summary uploads.
Option 3: Empty document
This option would modify the creation flow to first initialize storage with an empty document, followed by an upload using the normal (whole document summary) path. It's non-ideal in that it introduces an extra round-trip through the service but is nice in that it unifies the document creation and summary upload paths. Possibly the impact is negligible, given that it's used by the ODSP driver.
from fluidframework.
Note: There is pending work to investigate refactoring the monorepos, which might make it easier to share the "whole summaries" implementation between Historian, GitRest, and Tinylicious without duplication. (The work is still being planned/prioritized.)
from fluidframework.
Option 3 appears natural as simplifies summary transmission. Conceptually createContainer
covers the need of acquiring/generating the unique container identity (which in theory could be accomplished in different ways, hence optimizable in the future). In any case in the container lifecycle the referred extra round-trip is a one-time penalty not larger than the network latency. Supporting this proposal.
from fluidframework.
@jatgarg, can you confirm impact of #3? Does ODSP still make use of the extra round-trip? I might be missing something but I'm having a hard time finding it on the ODSP code.
from fluidframework.
Currently odsp only uses single round trip to create container on attach and upload the summary in same network call. Only in case of attachment blobs, it first creates an empty file and then upload the summary in a separate call. Double network call could impact perf in this case. Just handling the blob conversion properly which is specified as Option 1 could serve our purpose with lesser changes?
from fluidframework.
Confirm fixed. Tinylicious tracked by #17438.
from fluidframework.
Related Issues (20)
- Typescript error when listening to IContainer events
- Unexpected behavior for SharedString.findTile when searching at beginning/end of string HOT 5
- Move to semver >= 7.5.2
- ActivityTimeout event handling behavior not consistent in Deli HOT 2
- Deprecate mergeTree's findTile method HOT 1
- 6.1 release blocker: Add removed telemetry items HOT 1
- Remove type parameter from IntervalCollection's add method HOT 1
- Shredded summary upload service fails on compressed binary summary blobs. HOT 3
- Copy of the container with compressed binary summaries is failing. HOT 6
- Memory leak related to unbounded creation of debug loggers HOT 1
- Stop requiring guestDisplayName as pre-condition for requestSocketToken: true as part of joinSession payload HOT 2
- Browser - Database updates on a separate thread HOT 2
- SharedMatrix undefined cell values HOT 7
- Need to bump axios to 1.6.0+ (and test) to address vulnerability HOT 7
- Misbehaving driver can cause Fluid to hang on container open HOT 7
- Allow SharedTree to be passed across iframe boundary HOT 3
- Blazor SDK HOT 1
- Use @fluidframework/azure-client can not create container and get Error: 0x883 at app.js:125 HOT 3
- Intervals not at expected location sometimes after undo-ing HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluidframework.