Comments (20)
Thanks for the great detail behind this issue.
I have looked at the issue and tested against OneDrive Business & OneDrive Personal. It appears that this issue only affects OneDrive Business accounts. The issue itself it certainly related to ensuring that the metadata of an object is updated.
from onedrive.
Thanks for the update. I'm very happy to test if you think you find the cause.
from onedrive.
This issue is described in further detail here: OneDrive/onedrive-api-docs#778
Essentially, when a new file is created on OneDrive, it sets the file creation time to the date / time the file was created on the OneDrive platform. The 'onedrive' client currently then performs a 'patch' to reset the last modified date / time value to what the local file details are. SharePoint then sees this as a change and versions the file.
The resolution appears to look at the session upload capability and combine what the 'onedrive' client is attempting to do in a single step.
This will take a little bit of unraveling - but it is a starting point & potential path to resolution is clear.
from onedrive.
I've checked the behaviour with the versioning disabled in onedrive (suggested as a workaround in OneDrive/onedrive-api-docs#778. )
The result is that a single upload uses the correct amount of space (i.e. not double) and only a single version is created. However, the version history and file properties page show different dates (the date the file was created and the date the file was uploaded respectively).
from onedrive.
Run into a OneDrive API bug potentially - OneDrive/onedrive-api-docs#870
from onedrive.
Thanks for the work you've done on this. I've read the OneDrive API bug you created but I'm not sure how you think a workaround would work. Could you elaborate a little?
from onedrive.
I've just realised that you mean the workaround I described above ;-) I'll push ahead with that for now and keep an eye here in future.
from onedrive.
The OneDrive API team have confirmed that it is a bug that I have come across (OneDrive/onedrive-api-docs#870). A potential workaround for that has been provided which I need to test in order to progress the resolution of this bug.
from onedrive.
Just to update - a fix is progressing nicely. Should be able to finalise this in a few days.
from onedrive.
Thanks for the update. I'm very happy to test when you're ready.
from onedrive.
@jlarkin-oxford
Can you help validate https://github.com/abraunegg/onedrive/tree/Issue-%232 ?
This code switches the upload of new files to session objects & as part of the session includes the 'timeLastModified' fields so that it negates the need for the patch call for new files. I have verified locally that when uploading new files, only a single file is uploaded and has the correct timestamps.
from onedrive.
This has definitely helped in that I don't consume twice my storage allocation. There may be timestamp issue still but I'm not certain of the intended outcome. Here is my test procedure and results:
onedrive --version: onedrive v1.1.2-14-g491507a
delete ~/.config/onedrive/items.sqlite3*
Delete all files from online OneDrive account, empty recycle bin and second stage recycle bin.
Test case 1: Library versioning disabled as described here (This is the workaround mentioned in OneDrive/onedrive-api-docs#778)
Test case 2: Library versioning enabled with "Create major versions" selected and a maximum number of versions set to 10. I believe this was the default state from when my account was new and I first experienced this issue.
Command ran: onedrive --verbose --local-first --monitor --synchronize
In both cases, the outcome was the same:
- An upload of a 100MB file consumed 100MB of my storage allocation (correct)
- The timestamp of the file in the normal OneDrive web interface, once it finished uploading, shows the date the file was created in the "Modified" column (correct).
- Syncing the files onto a Windows PC shows that they have the timestamps for when the files were created (correct)
- In the Storage Metrics page online, the version history shows one version with the date and time the file was created (correct).
- On the main Storage Metrics page, before you click the link for a specific file's version history, the "Last Modified" column shows the date and time the file was uploaded (incorrect?).
- The parent folders for each file have a "Modified" date and time of when they were uploaded, in the web interface, storage metrics page and the sync'd Windows machine (incorrect?)
In any case, the fix has definitely solved the "double storage allocation" problem so I'm happy to close the issue if you want.
Thanks for all your help.
from onedrive.
On the main Storage Metrics page, before you click the link for a specific file's version history, the "Last Modified" column shows the date and time the file was uploaded
That is potentially a bug in the UI as without updating the last modified time, when you upload a file via the UI or by the client (when specifically set to not modify the timestamps), the file creation time / modified time are the same.
The parent folders for each file have a "Modified" date and time of when they were uploaded, in the web interface, storage metrics page and the sync'd Windows machine (incorrect?)
Potentially the same issue as above.
I have found one more part to fix with this issue - and that is when a file is modified, 2 version still get recorded, so this fix is incomplete.
from onedrive.
Is that not the intended design though? If I modify a file, and have specified that up to 10 versions should be kept, I would expect a second version to be stored. If I had specified that only a single version should be kept and two versions were being stored, that would be the problem.
from onedrive.
Not quite. What I am seeing is:
Modify file -> new file upload v.1
Update timestamp -> file now gets a v.2
So now you have 3 versions of the file for 2 activities - initial upload and simply updating the file once.
from onedrive.
Ah, I see. Yes, not quite as intended.
from onedrive.
It looks like another OneDrive API issue.
If the file to be uploaded as a "modification" already exists on OneDrive, and using the "replace" for @name.conflictBehavior
, 2 versions of the file are created - when the expectation should only be one.
Will have to get the OneDrive API team to investigate this.
from onedrive.
Opened a new case for this additional issue discovered:
OneDrive/onedrive-api-docs#877
Edit: Confirmed as a OneDrive API Bug
from onedrive.
Releasing this fix into 'master' as code changes were previously validated. Two file versions for OneDrive for Business will still get created when a modified file is uploaded, but this is due to OneDrive/onedrive-api-docs#877 and not this code now.
Additionally, once #23 is resolved, the checks that this application uses to verify that a file has indeed changed locally before uploading to OneDrive Business will lessen the impact of the OneDrive API issue above.
from onedrive.
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.
from onedrive.
Related Issues (20)
- Bug: Install on Debian 12 fails HOT 3
- Bug: Files modified on upload (doc/docx/xls/xlsx) with SharePoint Shared Libraries HOT 3
- Bug: Inconsistencies When Interrupted During Download Activity HOT 4
- Bug: Process: 374335 ExecStart=/usr/bin/onedrive --monitor (code=exited, status=1/FAILURE) HOT 2
- Bug: Issues with onedrive 2.5.0-rc1 HOT 28
- Bug: Spelling error in message in onedrive-2.5-rc HOT 2
- Bug: Segfault on Downloads HOT 11
- Bug: ERROR: An internal database error occurred: disk I/O error HOT 2
- Bug: Skipping item - invalid name (Microsoft Naming Convention) for aparently good folder names. HOT 3
- Bug: Older versions of onedrive pulled from Docker Hub HOT 2
- Feature Request: Docker Environment Variable for `--sync-shared-files` HOT 2
- Bug: dbus not found HOT 4
- Bug: Does not synchronize during "Performing a database consistency" HOT 4
- Feature Request: Consider adding support for the OAuth2 Device Authorization Flow HOT 5
- Feature Request: Can the printing time be added to the log? HOT 4
- Bug: Synchorinze is not working on subfolder HOT 4
- Bug: Synced file is removed when updated on the remote while being processed by onedrive HOT 10
- Feature Request: Add file path to warnings HOT 3
- Feature Request: Multi-threadded synchronization HOT 2
- Feature Request: Add information about file creator/last editor as extended file attributes HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onedrive.