A 'structured' file kind beside text and blob #44
Labels
No labels
area:docs
area:identity
area:ops
area:plugin
area:server
channel:community
channel:direct
channel:owned
channel:press
channel:social
e2ee-constrained
gate:at-ga
gate:pre-ga
marketing
parity
relay:absent
relay:planned
relay:requested
relay:supported
risk:additive
risk:contract
risk:none
usability
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Nectenda/nectenda#44
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of #37. Prerequisite for the rest of Phase 17.
The finding this rests on
The server needs no change.
packages/server/src/doc-store.tsstates it inits own header — "Nothing in this file interprets
payload" — and the codematches:
appendUpdate,getUpdatesSinceandputSnapshottreat the payload asa BLOB and the name as opaque past the folder-id prefix. The only
Y.Docinws-server.tsis an empty shell for awareness; there is noY.applyUpdateoutside tests.
This is not a hopeful reading. The folder listing is already a
Y.Map(
file-sync.ts:109,ydoc.getMap('files')) travelling the identical encryptedpipeline. A Map-shaped document is a shape the server already carries in
production.
What we do today
packages/plugin/src/blob-policy.ts:28returns exactly three kinds, and only.mdis text:The file's own comment explains why
.canvasand.jsonare blobs — JSON mergedcharacter-wise under concurrent edit produces something syntactically invalid
that looks fine until opened. That reasoning is sound and this issue does not
overturn it: the answer is not to treat canvas as text, but to add a third
kind that merges structurally.
What changes
structuredmember ofFileKind.structured-sync.tsbesidecontent-sync.ts, binding a file toY.Map/Y.Arrayrather thanY.Text, serialising to disk on change.__meta__listing document, following the precedent Phase 8set with
Y.Map('blobs'): older clients never callgetMapon it, so theyreplicate entries faithfully and cannot act on them.
vault-watcher.tsandfile-sync.ts.Migration
.canvasfiles already synced are blobs. They must convert. Cheap while the userbase is small; it will not get cheaper.
Risk
risk:noneat the server. Client-only.Verification
Falsify the load-bearing claim: sync a structured document end to end against
an unmodified server. If that needs a server change, this issue's risk rating
is wrong and Phase 17's sequencing changes.
Moved to the Vikunja board as NEC-21: https://projectron.nerchure.com/tasks/21