Issue Description
A client sends one FileNode/set that moves a file from folder A to folder B and destroys A with onDestroyRemoveChildren set to true. A sync client does this when it replays “mv A/keep.txt B/” followed by “rm -r A” as one batch. On the v1.0.0 branch the move is rejected with willDestroy and the file is destroyed together with A. Its content is gone too: downloading the file’s blobId returns 404 right after the call.
With onDestroyRemoveChildren set to false the server does the opposite. Moving every child of A to B and destroying A in the same call works, and the files are kept. So with the flag false the moved files no longer count as children of A, and with the flag true they are deleted as children of A.
Expected Behavior
The moved file ends up in B, and only what is still in A at the end of the call is destroyed.
Actual Behavior
A = ur, B = uu, keep.txt = us, drop.txt = ut:
["FileNode/set", {"accountId": "w", "update": {"us": {"parentId": "uu"}},
"destroy": ["ur"], "onDestroyRemoveChildren": true}, "0"]
<- {"oldState": "sv2aq", "newState": "swaaq", "destroyed": ["ut", "us", "ur"],
"notUpdated": {"us": {"type": "willDestroy", "description": "ID will be destroyed."}}}
["FileNode/get", {"accountId": "w", "ids": ["us", "ut", "ur"]}, "0"]
<- "list": [], "notFound": ["us", "ut", "ur"]
GET download URL for keep.txt's blobId (200 before the call) -> HTTP 404
For comparison, the same kind of call with the flag false (folder C = uv holding c1.txt = uw and c2.txt = ux) keeps both files:
["FileNode/set", {"accountId": "w", "update": {"uw": {"parentId": "uu"}, "ux": {"parentId": "uu"}},
"destroy": ["uv"], "onDestroyRemoveChildren": false}, "0"]
<- "updated": {"uw": {...}, "ux": {...}}, "destroyed": ["uv"]
Reproduction Steps
- Upload a small blob and create a folder with A and B in it, and keep.txt and drop.txt inside A.
- In one FileNode/set, move keep.txt to B and destroy A with onDestroyRemoveChildren true.
- Call FileNode/get for keep.txt. It is notFound, and its blob download returns 404.
1. ["FileNode/set", {"accountId": "<acc>", "create": {
"t": {"name": "test", "parentId": null},
"a": {"name": "A", "parentId": "#t"},
"b": {"name": "B", "parentId": "#t"},
"k": {"name": "keep.txt", "parentId": "#a", "blobId": "<blob>"},
"d": {"name": "drop.txt", "parentId": "#a", "blobId": "<blob>"}}}, "0"]
2. ["FileNode/set", {"accountId": "<acc>", "update": {"<keep>": {"parentId": "<B>"}},
"destroy": ["<A>"], "onDestroyRemoveChildren": true}, "0"]
3. ["FileNode/get", {"accountId": "<acc>", "ids": ["<keep>"]}, "0"]
Stalwart Version
v0.16.x
Installation Method
Built from source
Database Backend
RocksDB
Blob Storage
RocksDB
Search Engine
Internal
Directory Backend
Internal
Additional Context
On the 1.0 deleted branch
I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.
on
I have searched this support forum (open and closed topics) and confirm this is not a duplicate.
on
I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.
on