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

Check timestamp to ensure that latest timestamp is used when comparing OneDrive changes (Issue #505) #506

Merged
merged 3 commits into from
May 22, 2019

Conversation

abraunegg
Copy link
Owner

  • If OneDrive presents a change to download and the file already exists, check the local modified timestamp to ensure that the local file is not technically newer than the file we are going to download

abraunegg added 2 commits May 21, 2019 09:02
* If OneDrive presents a change to download and the file already exists, check the local modified timestamp to ensure that the local file is not technically newer than the file we are going to download
* Update localtime check for new items
@abraunegg
Copy link
Owner Author

abraunegg commented May 21, 2019

reproduction steps:

  1. perform a manual or monitor sync
  2. modify a file locally
  3. perform a manual or monitor sync with --resync unnecessarily added to rebuild the database

without patch:

(dmd-2.085.0)[alex@centos7full onedrive]$ ./onedrive --confdir '~/.config/onedrive-preining' --synchronize --verbose --resync
Using Config Dir: /home/alex/.config/onedrive-preining
Deleting the saved status ...
Initializing the OneDrive API ...
Opening the item database ...
All operations will be performed in: /home/alex/OneDrivePreining
Initializing the Synchronization Engine ...
Account Type: business
Default Drive ID: b!eRoTwf855UO30XBlm3Yz-NYBVmMu24pHvgrM4OUip-8F1LO13vWcT5o0bEQr4zit
Default Root ID: 01WOGXO2N6Y2GOVW7725BZO354PWSELRRZ
Remaining Free Space: 1099097097240
Fetching details for OneDrive Root
OneDrive Root does not exist in the database. We need to add it.
Added OneDrive Root to the local database
Syncing changes from OneDrive ...
Applying changes of Path ID: 01WOGXO2N6Y2GOVW7725BZO354PWSELRRZ
Skipping item - excluded by skip_file config: ~tmpB5_.newfile.txt.swp
The local item has a different modified time 2019-May-21 19:47:09Z remote is 2019-May-21 19:41:25Z
The local item has a different hash
The local item is out of sync, renaming: newfile.txt -> newfile-centos7full.txt
Downloading file newfile.txt ... done.
Uploading differences of .
Processing root
The directory has not changed
Processing newfile.txt
The file has not changed
Uploading new items of .
Uploading new file ./newfile-centos7full.txt ...
Uploading 100% |oooooooooooooooooooooooooooooooooooooooo|   ETA   --:--:--:                                                                                                             
 done.
Remaining free space: 1099097097189
Applying changes of Path ID: 01WOGXO2N6Y2GOVW7725BZO354PWSELRRZ
(dmd-2.085.0)[alex@centos7full onedrive]$ 

with patch:

(dmd-2.085.0)[alex@centos7full onedrive-issue-505]$ ./onedrive --confdir '~/.config/onedrive-preining' --synchronize --verbose --resync
Using Config Dir: /home/alex/.config/onedrive-preining
Deleting the saved status ...
Initializing the OneDrive API ...
Opening the item database ...
All operations will be performed in: /home/alex/OneDrivePreining
Initializing the Synchronization Engine ...
Account Type: business
Default Drive ID: b!eRoTwf855UO30XBlm3Yz-NYBVmMu24pHvgrM4OUip-8F1LO13vWcT5o0bEQr4zit
Default Root ID: 01WOGXO2N6Y2GOVW7725BZO354PWSELRRZ
Remaining Free Space: 1099097097812
Fetching details for OneDrive Root
OneDrive Root does not exist in the database. We need to add it.
Added OneDrive Root to the local database
Syncing changes from OneDrive ...
Applying changes of Path ID: 01WOGXO2N6Y2GOVW7725BZO354PWSELRRZ
The local item has a different modified time 2019-May-21 19:41:25Z remote is 2019-May-21 19:40:54Z
The local item has a different hash
Local item modified time is newer based on UTC time conversion
Uploading differences of .
Processing root
The directory has not changed
Processing newfile.txt
The file last modified time has changed
The file content has changed
Uploading modified file newfile.txt ... 
Uploading 100% |oooooooooooooooooooooooooooooooooooooooo|   ETA   --:--:--:                                                                                                             
done.
Uploading new items of .
Applying changes of Path ID: 01WOGXO2N6Y2GOVW7725BZO354PWSELRRZ
(dmd-2.085.0)[alex@centos7full onedrive-issue-505]$ 

@abraunegg abraunegg requested a review from norbusan May 21, 2019 19:50
@abraunegg abraunegg added this to the v2.3.4 milestone May 21, 2019
@abraunegg
Copy link
Owner Author

if file is truly newer on OneDrive:

(dmd-2.085.0)[alex@centos7full onedrive-issue-505]$ ./onedrive --confdir '~/.config/onedrive-preining' --synchronize --verbose --resync
Using Config Dir: /home/alex/.config/onedrive-preining
Deleting the saved status ...
Initializing the OneDrive API ...
Opening the item database ...
All operations will be performed in: /home/alex/OneDrivePreining
Initializing the Synchronization Engine ...
Account Type: business
Default Drive ID: b!eRoTwf855UO30XBlm3Yz-NYBVmMu24pHvgrM4OUip-8F1LO13vWcT5o0bEQr4zit
Default Root ID: 01WOGXO2N6Y2GOVW7725BZO354PWSELRRZ
Remaining Free Space: 1099097095242
Fetching details for OneDrive Root
OneDrive Root does not exist in the database. We need to add it.
Added OneDrive Root to the local database
Syncing changes from OneDrive ...
Applying changes of Path ID: 01WOGXO2N6Y2GOVW7725BZO354PWSELRRZ
The local item has a different modified time 2019-May-21 19:54:57Z remote is 2019-May-21 19:55:52Z
The local item has a different hash
Remote item modified time is newer based on UTC time conversion
The local item is out-of-sync with OneDrive, renaming to preserve existing file: newfile.txt -> newfile-centos7full.txt
Downloading file newfile.txt ... done.
Uploading differences of .
Processing root
The directory has not changed
Processing newfile.txt
The file has not changed
Uploading new items of .
Uploading new file ./newfile-centos7full.txt ...
Uploading 100% |oooooooooooooooooooooooooooooooooooooooo|   ETA   --:--:--:                                                                                                             
 done.
Remaining free space: 1099097095229
Applying changes of Path ID: 01WOGXO2N6Y2GOVW7725BZO354PWSELRRZ
(dmd-2.085.0)[alex@centos7full onedrive-issue-505]$ 

@abraunegg
Copy link
Owner Author

Given #23 fixed the file hashing issues the original client had, there are not going to be any hash clash issues as well (which was the root cause of many files being replicated with hostname being added) .. this should be good to go once reviewed.

* Update log message to indicate we are keeping local item
@abraunegg abraunegg merged commit 239085f into master May 22, 2019
@abraunegg abraunegg changed the title WIP: Check timestamp to ensure that latest timestamp is used when comparing OneDrive changes (Issue #505) Check timestamp to ensure that latest timestamp is used when comparing OneDrive changes (Issue #505) May 22, 2019
@abraunegg abraunegg deleted the Issue-#505 branch May 22, 2019 19:39
@lock
Copy link

lock bot commented Jun 21, 2019

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

@lock lock bot locked and limited conversation to collaborators Jun 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant