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

Files get saved even if they have not been altered #3543

Closed
max-nextcloud opened this issue Dec 9, 2022 · 9 comments
Closed

Files get saved even if they have not been altered #3543

max-nextcloud opened this issue Dec 9, 2022 · 9 comments

Comments

@max-nextcloud
Copy link
Collaborator

max-nextcloud commented Dec 9, 2022

@meonkeys reported in #2337 (comment) that saving files without changes is back

Files will be saved even if they have not been touched if they contain a bare link link such as:

https://nitter.net/meonkeys

Links such as this are fine:

[Adam Monsen on Twitter, via Nitter](https://nitter.net/meonkeys)

Note that this URLs target HTML data includes OpenGraph metadata.

update: Headings also lead to the same effect.

Files with zero bare links and no headings are correctly left unmodified if I open them and make zero changes. Files with bare links or headings are marked as modified.

@meonkeys
Copy link
Contributor

meonkeys commented Dec 14, 2022

I was able to repro with a fresh 25.0.2.3 server created with docker run -d -p 8080:80 --name nextcloud nextcloud. I opened Documents/Readme.md, made no changes, then closed it, and it showed up in the activity feed as "changed".

Screenshot from 2022-12-14 08-42-52

Screenshot from 2022-12-14 08-43-18

Here are the entire contents of Readme.md:

# Documents

Nextcloud works well with all the common document formats. You can even collaborate with others on ODT and Markdown files!

135 bytes. No EOL at the end of the file. SHA-1 checksum is eb37821f747d23af2524a69892aa5e2b7399a204, before and after opening the file.

Docker image SHA256 id is 60c973f142142baeb88314fb33de083ba1a3967d5774597ecb0bf323fdc0ec52.

@max-nextcloud
Copy link
Collaborator Author

@meonkeys Thanks, I was able to reproduce that too. I tried with another file i created that did not contain a heading and it did not get saved. I was able to reproduce it on another server and again it would only be saved automatically when it contained a heading.

@meonkeys
Copy link
Contributor

meonkeys commented Dec 30, 2022

Will you remove Link preview from the title of this bug? Since we have a repro without that.

See also:

#2686

#2337

Also, not sure if this is related, but I'm seeing an issue when I use Temporary files lock. I try to edit a file locally, so it is locked. I make a change locally while I am definitely the only one making changes, but I still get a local conflict. Makes me think the root cause is something in the server inappropriately changing file last modified dates (as opposed to in the Text app). Just another data point, I guess. I hope this is helpful.

...ah, I might be seeing #2200

@max-nextcloud max-nextcloud changed the title Link preview leads to files getting saved even if they have not been altered Files get saved even if they have not been altered Dec 30, 2022
@max-nextcloud
Copy link
Collaborator Author

Will you remove Link preview from the title of this bug?

Sure. Good point. Also added the heading scenario to the description.

max-nextcloud added a commit that referenced this issue Jan 5, 2023
Including tests that open and close do not save unedited files.
Test is currently still failing for open.

See #3543.

Signed-off-by: Max <max@nextcloud.com>
max-nextcloud added a commit that referenced this issue Jan 5, 2023
Including tests that open and close do not save unedited files.
Test is currently still failing for open.

See #3543.

Signed-off-by: Max <max@nextcloud.com>
@meonkeys
Copy link
Contributor

meonkeys commented Jan 19, 2023

Works as expected for me in 25.0.3! 🎁

Ah, wait: I just opened a .md file and it saved it (even though I didn't make changes). It seems like, in 25.0.3, bare links do not trigger a save but headings do. Let me know if you want any help testing/verifying and I'll do my best.

@max-nextcloud
Copy link
Collaborator Author

I found a solid fix for this in 26: Files will only be saved if changes were made to them that can be reverted through the UI. So any changes made automatically by the different extensions will not count. I'll look into backporting this at least to 25 but it might not be trivial.
Will leave this issue open as a reminder for the backport.

@mejo-
Copy link
Member

mejo- commented Mar 24, 2023

@max-nextcloud do you still think it's feasable to backport this to 25? Otherwise I'd suggest to close the issue.

@datenangebot
Copy link

Tested:
fresh nc25 via docker-setup: no save action if content did not change (no "edit" activities entry)
fresh nc28-dev via docker-setup: no save action if content did not change (no "edit" activities entry)

so seems to be good. Will close for now.

@juliushaertl
Copy link
Member

If this is still an issue please open a fresh ticket with the file before and after open to reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants