-
-
Notifications
You must be signed in to change notification settings - Fork 849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Item deleted after events of IN_MOVED_FROM & IN_CLOSE_WRITE #2586
Comments
It's worth noting that the Monitor received the 3 events in one Actually it's 6 events in one
|
@yousong It is sending a delete file request with the incorrect item due to '4913' file .. which is a vim issue. You need to add '4913' to your skip_file configuration. |
@abraunegg It's not |
@yousong 'vim' is generating the events including the delete. This client is handling these events, in order, as required for normal client operations. This is not a bug with this client, but is an issue with 'vim'. Your options are:
|
@abraunegg Here is a simple python script for reproducing the issue. import os
os.rename('test.md', '/tmp/test.md')
with open('test.md', 'w') as fout:
fout.write('hello') Save it as Run the following shell command
|
@abraunegg Note that Vim is NOT involved in the reproduction steps here. |
@yousong You are moving a file out which is a DELETE event .. you are creating the DELETE event. Reproduction or not - you are causing the issue. |
Yes. vim or whatever program is generating the events. BUT, the onedrive client is NOT handling these events, in order. It handles the close_write first then the moved_from event. Whereas the event order is moved_from , then close_write |
The current behavior of the client is very flawed I may say. It will delete the file on the remote side, the moment after user updates content with programs like vim. |
FYI your proof python script also fails:
No issue, as current user, copying the file to
Now .. in testing your claim: onedrive client version v2.4.x
This demonstrates the issue you are claiming. onedrive client version v2.5.x - 'alpha-5'
Contents onlineThe current 'inotify' handling in 'alpha-5' is the same as v2.4.x ... so I cannot detail why there is a difference in order handling at this stage - and I am not going to diagnose this further as there is no issue identified in v2.5.x codebase. The net result here:
|
FYI, likely your The important thing is how the onedrive program handles the 3 events coming in a single read call.
Glad that no issue with v2.5.x. Thank you for your time and efforts. For now I am going to stick with v2.4.25 with a minor local temp fix Fix path got deleted in handling of move & close_write event |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Describe the bug
I use vim to edit files stored in onedrive data dir. On save and quit (
:wq
), vim will do the followingbackupdir
O_CREAT
) and close the fileIf vim
backupdir
is set to a directory unknown to the onedrive app, the app will only receiveIN_MOVED_FILE
event, no matchingIN_MOVED_TO
.The event sequence onedrive app received is like the following as decoded from strace output
The issue is that onedrive app handles
IN_CLOSE_WRITE
first (upload), and at the end itassume that the items moved outside the watched directory have been deleted
. So I observed the following log.Relevant code in
src/monitor.d
onedrive/src/monitor.d
Lines 371 to 388 in 1a88d33
Operating System Details
Client Installation Method
From Distribution Package
OneDrive Account Type
Personal
What is your OneDrive Application Version
v2.4.25
What is your OneDrive Application Configuration
Where is your 'sync_dir' located
Local
What are all your system 'mount points'
What are all your local file system partition types
How do you use 'onedrive'
Not relevant
Steps to reproduce the behaviour
let &backupdir = $HOME . "/.vim.tmp.d"
:wq
) the fileComplete Verbose Log Output
Screenshots
No response
Other Log Information or Details
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: