mirror of
https://github.com/rclone/rclone.git
synced 2026-06-30 02:45:04 -04:00
The mega backend keeps the whole account as an in-memory tree which go-mega reconciles asynchronously from the server's event stream. After an upload, delete or move, the optimistic local update could be undone moments later when go-mega replayed the corresponding server event, re-adding a node to its parent. In a long-running process such as mount or serve this showed up as a deleted file lingering in directory listings (a "ghost") until the next event poll, or reappearing after a move. Wait for the server to confirm uploads, deletes and moves so the in-memory tree is settled before returning, matching what Rmdir and Purge already do. The move wait was also previously started after the server-side move so only the rename was covered.