mirror of
https://github.com/rclone/rclone.git
synced 2026-07-01 03:15:06 -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 could briefly show a just-deleted file in a listing, or make a moved file reappear shortly afterwards. 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. Add an internal test reproducing the lingering listing via a tight put/remove/list loop.