-
-
Notifications
You must be signed in to change notification settings - Fork 871
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: Any time I save a text file with Geany it will soon say the copy on the disk is newer than the one in the buffer and ask if I want to re-read it. #3124
Comments
@adventuretc This is technically not a bug - sorry. When you upload data to Microsoft OneDrive, the Microsoft API changes your file including timestamp. To ensure that what is online, is what is local, and to ensure values align this is why the local file timestamp is updated to reflect that online. That your application reports the file has changed is probably the actual issue. The content has not changed, the timestamp has .... Please raise a bug against 'Geany' as they need to implement a better method of file modification detection. |
I disagree with how this is implemented in the client. The local file should be left as is and considered equivalent to the one online if the timestamp is within the whatever range Microsoft decides to modify it. No need to age the disk or change files, from my understanding. Am I missing something? |
When the files are the same by their contents, what is online is already what is local by your definition of modification checking that you want Geany to set up to. |
Lets break this question down. You are using 'Business | Office365' which means by default your account type when running the application should be 'business' - the API derives this. You can also validate this by the length of your default driveId. If this is 16 characters in length then this is a 'personal' account type and not a 'business' account type. The account type is super important here. You can run the client in verbose mode Microsoft, in their wisdom, back end all 'business' accounts with Microsoft SharePoint. This technology stack has an awesome 'feature' (bug) that modifies your file post upload - and there is zero capability to disable this. To help you understand this 'feature' please read OneDrive/onedrive-api-docs#935 . In this situation your 'file' is 100% different online to local. Now, if your account type is 'personal' (again, you may think you are business | office365 .. but what does the API report it as) ... at least you are not forced with the above SharePoint 'feature', however the way that the graph API works for 'personal' accounts is that when a file is uploaded a new 'version' of the file is created, and, that creation process makes the new file with your data have a new timestamp. Now .. depending on how the file is uploaded, the upload mechanism is different. For small files (<4Mb) you must use the simple upload method. For files >4 you must upload via a session:
When you use the simple method, the expectation is that the file that you upload, is stored by the Microsoft OneDrive platform - and it is, but a new version is created, with a new timestamp. When you use the session method, you can provide the timestamp to use, and the client does this, however, when a new file version is created, the Microsoft OneDrive platform again changes the timestamp provided. In the response JSON from Microsoft OneDrive, this then provides both the new hash of the file online + the new online timestamp. The client then evaluates this data and makes a number of decisions:
The client does this to ensure that your data locally matches what is online, so that the client, when reading the Graph API data to determine if anything has changed, can accurately process online changes to bring down to your system. Without doing this, the client will always assume your local files are out-of-date or are potentially older that is what stored online .. thus you may get into a data loss scenario which is not something anyone would like. Whilst you may find this to be annoying - it is the application you are using to edit your files that is being overly sensitive on how it detects changed files. If you are using a 'business' account and your application is looking at metadata for change - then yes maybe this is actually factually correct due to the SharePoint feature you cannot turn off .... or .. it is simply watching the changed timestamp which is going to be problematic. You can also disable integrity checking to disable how the client handles these online features. Please read:
Firstly I would see if your application can use If this is not possible, then configure a 'skip_file' rule to skip these temporary file types if possible.
You need to ensure that 'Geany' is doing some sort of hash check rather than a timestamp check. |
Thank you. Now I understand. |
Unfortunately you cannot circumvent that SharePoint feature. If you walk through what happens to your file on SharePoint you will understand why circumvention is not possible. |
Describe the bug
Any time I save a text file with Geany it will soon say the copy on the disk is newer than the one in the buffer and (Geany) asks whether I want to re-read it or overwrite it.
Geany works by saving the file to a dummy file e.g. ".goutputstream-ABC1234" and then rename it to the original file name or something like that, to my understanding.
Operating System Details
Linux NN 5.15.0-131-generic #141~20.04.1-Ubuntu SMP Thu Jan 16 18:38:51 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Distributor ID: Ubuntu Description: Ubuntu 20.04.6 LTS Release: 20.04 Codename: focal
Client Installation Method
From 3rd Party Source (PPA, OpenSuSE Build Service etc)
OneDrive Account Type
Business | Office365
What is your OneDrive Application Version
onedrive v2.5.4-1+np1+1.1
What is your OneDrive Application Configuration
What is your 'curl' version
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'
I use onedrive on my Linux desktop computer.
Steps to reproduce the behaviour
Create a text file. Modify it with Geany. Then, open the text file from a file manager again. The problem should appear.
The bug doesn't arise when onedrive is not running.
Complete Verbose Log Output
Screenshots
No response
Other Log Information or Details
Additional context
No response
The text was updated successfully, but these errors were encountered: