refactor(notes): remove legacy whole-document saves; all block changes go through sync
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 1m14s
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 1m14s
Phase 5 of the collaboration plan:
- Remove PATCH /documents/{id}/blocks, PatchDocumentBlocks, the
DOC_BLOCKS_PATCHED event and its types, FlushDocumentState and
LoadDocumentState. PUT /documents/{id} rejects blocks (400) and only
changes title, icon, folder and pin; editors may now change title/icon.
- The to-do overview ticks via a single operation on /docs/{id}/sync
(new skipLog flag). Task links set the block tick with a targeted
operation and notify open editors; creating a linked task needs edit
rights.
- Keep the three share tables: DocRole already decides centrally, and
rewriting the visibility queries would only add risk (documented in plan).
- Tests adapted to the new paths; share e2e test now also ticks a to-do in
the overview.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8b7a53daab
commit
aea4324c20
18 files changed
+155
-376
No files matched your search
@@ -77,9 +77,7 @@ func TestLegacySaveRoundTripsThroughTheLog(t *testing.T) {
|
||||
|
||||
// Saving the same content again must not produce any log entries
|
||||
head := headSeq(t, s, doc.ID)
|
||||
if _, err := s.UpdateDocument(u.ID, doc.ID, nil, nil, nil, &initial, nil, nil); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
s.replaceDocBlocksInDB(doc.ID, u.ID, initial, "")
|
||||
if h := headSeq(t, s, doc.ID); h != head {
|
||||
t.Fatalf("unchanged save wrote %d log entries", h-head)
|
||||
}
|
||||
@@ -92,9 +90,7 @@ func TestLegacySaveRoundTripsThroughTheLog(t *testing.T) {
|
||||
[3]interface{}{"c", 1, "Detail"},
|
||||
[3]interface{}{"n", 2, "Neu"},
|
||||
)
|
||||
if _, err := s.UpdateDocument(u.ID, doc.ID, nil, nil, nil, &changed, nil, nil); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
s.replaceDocBlocksInDB(doc.ID, u.ID, changed, "")
|
||||
got, _ = s.GetDocumentByID(u.ID, doc.ID)
|
||||
sameOutline(t, got.Blocks, changed)
|
||||
|
||||
|
||||
Reference in new issue
Block a user