Skip to content
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

Handle deletion events when inotify events are missing #1073

Merged
merged 3 commits into from Sep 24, 2020

Conversation

abraunegg
Copy link
Owner

  • Handle the missing inotify events for deleted items as a deletion event when running in --monitor

* Handle the missing inotify events for deleted items as a deletion event when running in --monitor
@abraunegg abraunegg linked an issue Sep 24, 2020 that may be closed by this pull request
@abraunegg
Copy link
Owner Author

Without PR:

./onedrive --confdir '~/.config/onedrive-personal/' --monitor --verbose
Using 'user' Config Dir: /home/alex/.config/onedrive-personal/
Using 'system' Config Dir: 
Configuration file successfully loaded
Notification (dbus) server not available, disabling
Initializing the OneDrive API ...
Configuring Global Azure AD Endpoints
Opening the item database ...
All operations will be performed in: /home/alex/OneDrivePersonal
Application version: v2.4.5-19-g38e9cc1
Account Type: personal
Default Drive ID: 66d53be8a5056eca
Default Root ID: 66D53BE8A5056ECA!101
Remaining Free Space: 5368709120
Fetching details for OneDrive Root
OneDrive Root exists in the database
Initializing the Synchronization Engine ...
Initializing monitor ...
OneDrive monitor interval (seconds): 30
Monitor directory: .
Starting a sync with OneDrive
Applying changes of Path ID: 66D53BE8A5056ECA!101
Updated Remaining Free Space: 5368709120
Uploading differences of ~/OneDrivePersonal
Processing .
The directory has not changed
Uploading new items of ~/OneDrivePersonal
Applying changes of Path ID: 66D53BE8A5056ECA!101
Updated Remaining Free Space: 5368709120
Processing 1 OneDrive items to ensure consistent local state due to a full scan being requested
Sync with OneDrive is complete
[M] File changed: ./test.txt
Uploading differences of ./test.txt
Uploading new items of ./test.txt
Uploading new file ./test.txt ... done.
Remaining free space on OneDrive: 5368709095
^CGot termination signal, shutting down db connection
(dmd-2.092.0)[alex@centos7full onedrive]$ ./onedrive --confdir '~/.config/onedrive-personal/' --monitor --verbose
Using 'user' Config Dir: /home/alex/.config/onedrive-personal/
Using 'system' Config Dir: 
Configuration file successfully loaded
Notification (dbus) server not available, disabling
Initializing the OneDrive API ...
Configuring Global Azure AD Endpoints
Opening the item database ...
All operations will be performed in: /home/alex/OneDrivePersonal
Application version: v2.4.5-19-g38e9cc1
Account Type: personal
Default Drive ID: 66d53be8a5056eca
Default Root ID: 66D53BE8A5056ECA!101
Remaining Free Space: 5368709095
Fetching details for OneDrive Root
OneDrive Root exists in the database
Initializing the Synchronization Engine ...
Initializing monitor ...
OneDrive monitor interval (seconds): 30
Monitor directory: .
Starting a sync with OneDrive
Applying changes of Path ID: 66D53BE8A5056ECA!101
Updated Remaining Free Space: 5368709095
Number of items from OneDrive to process: 2
Uploading differences of ~/OneDrivePersonal
Processing .
The directory has not changed
Processing test.txt
The file appears to have been deleted locally .. but we are running in --monitor mode. This may have been 'moved' rather than 'deleted'
Uploading new items of ~/OneDrivePersonal
Applying changes of Path ID: 66D53BE8A5056ECA!101
Updated Remaining Free Space: 5368709095
Processing 1 OneDrive items to ensure consistent local state due to a full scan being requested
Sync with OneDrive is complete
Starting a sync with OneDrive
Applying changes of Path ID: 66D53BE8A5056ECA!101
Updated Remaining Free Space: 5368709095
Uploading differences of ~/OneDrivePersonal
Processing .
The directory has not changed
Processing test.txt
The file appears to have been deleted locally .. but we are running in --monitor mode. This may have been 'moved' rather than 'deleted'
Uploading new items of ~/OneDrivePersonal
Applying changes of Path ID: 66D53BE8A5056ECA!101
Updated Remaining Free Space: 5368709095
Sync with OneDrive is complete
^CGot termination signal, shutting down db connection

No deletion action to remove file from OneDrive.

With PR:

./onedrive --confdir '~/.config/onedrive-personal/' --monitor --verbose
Using 'user' Config Dir: /home/alex/.config/onedrive-personal/
Using 'system' Config Dir: 
Configuration file successfully loaded
Notification (dbus) server not available, disabling
Initializing the OneDrive API ...
Configuring Global Azure AD Endpoints
Opening the item database ...
All operations will be performed in: /home/alex/OneDrivePersonal
Application version: v2.4.5-20-g4a5818b
Account Type: personal
Default Drive ID: 66d53be8a5056eca
Default Root ID: 66D53BE8A5056ECA!101
Remaining Free Space: 5368709120
Fetching details for OneDrive Root
OneDrive Root exists in the database
Initializing the Synchronization Engine ...
Initializing monitor ...
OneDrive monitor interval (seconds): 30
Monitor directory: .
Starting a sync with OneDrive
Applying changes of Path ID: 66D53BE8A5056ECA!101
Updated Remaining Free Space: 5368709120
Uploading differences of ~/OneDrivePersonal
Processing .
The directory has not changed
Uploading new items of ~/OneDrivePersonal
Applying changes of Path ID: 66D53BE8A5056ECA!101
Updated Remaining Free Space: 5368709120
Processing 1 OneDrive items to ensure consistent local state due to a full scan being requested
Sync with OneDrive is complete
[M] File changed: ./test.txt
Uploading differences of ./test.txt
Uploading new items of ./test.txt
Uploading new file ./test.txt ... done.
Remaining free space on OneDrive: 5368709095
^CGot termination signal, shutting down db connection
(dmd-2.092.0)[alex@centos7full onedrive-pr1073]$ ./onedrive --confdir '~/.config/onedrive-personal/' --monitor --verbose
Using 'user' Config Dir: /home/alex/.config/onedrive-personal/
Using 'system' Config Dir: 
Configuration file successfully loaded
Notification (dbus) server not available, disabling
Initializing the OneDrive API ...
Configuring Global Azure AD Endpoints
Opening the item database ...
All operations will be performed in: /home/alex/OneDrivePersonal
Application version: v2.4.5-20-g4a5818b
Account Type: personal
Default Drive ID: 66d53be8a5056eca
Default Root ID: 66D53BE8A5056ECA!101
Remaining Free Space: 5368709095
Fetching details for OneDrive Root
OneDrive Root exists in the database
Initializing the Synchronization Engine ...
Initializing monitor ...
OneDrive monitor interval (seconds): 30
Monitor directory: .
Starting a sync with OneDrive
Applying changes of Path ID: 66D53BE8A5056ECA!101
Updated Remaining Free Space: 5368709095
Number of items from OneDrive to process: 2
Uploading differences of ~/OneDrivePersonal
Processing .
The directory has not changed
Processing test.txt
The file appears to have been deleted locally .. but we are running in --monitor mode. This may have been 'moved' on the local filesystem rather than being 'deleted'
Deleting item from OneDrive: test.txt
Uploading new items of ~/OneDrivePersonal
Applying changes of Path ID: 66D53BE8A5056ECA!101
Updated Remaining Free Space: 5368709120
Processing 2 OneDrive items to ensure consistent local state due to a full scan being requested
Processing 1 OneDrive items to ensure consistent local state due to a full scan being requested
Sync with OneDrive is complete
^CGot termination signal, shutting down db connection

Deletion event now occurs correctly.

@abraunegg abraunegg added this to the v2.4.6 milestone Sep 24, 2020
@abraunegg
Copy link
Owner Author

Regression introduced here: e321c37#diff-a601932e4174e1bb743e6ea51f804d01

@abraunegg
Copy link
Owner Author

User confirmed as fixed with PR, restoring prior functionality lost due to #948 oversight.

Copy link
Collaborator

@norbusan norbusan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed

@abraunegg abraunegg merged commit 7684c74 into master Sep 24, 2020
@abraunegg abraunegg deleted the fix-issue-1072 branch September 24, 2020 22:22
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators May 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

monitoring mode change in behaviours
2 participants