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

[Bug]: Read only shared text file is not up-to-date with saved file #2388

Closed
4 of 8 tasks
niowniow opened this issue May 12, 2022 · 7 comments · Fixed by #6094
Closed
4 of 8 tasks

[Bug]: Read only shared text file is not up-to-date with saved file #2388

niowniow opened this issue May 12, 2022 · 7 comments · Fixed by #6094

Comments

@niowniow
Copy link

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

Offline edits of a shared text file (shared as non-editable) which are then synced are not updated in the in-browser view of the shared file

Steps to reproduce

  1. create a text file in nextcloud
  2. edit it with the in built-in text editor
  3. share the next file via public link without allowing editing
  4. sync the file using the desktop client
  5. edit synced file offline
  6. sync again
  7. the shared document does not show the changes
  8. open the file in the nextcloud text editor
    The warning appears:
    image
    and I can choose "use current version" or "use saved version".
  9. Clicking "use saved version" updates the shared file

Expected behavior

Any changes to the file saved in the nextcloud are reflected in the shared file. The saved text file (i.e. the file that is in the nextcloud filesystem) is shown in the shared in-browser text file view, not any other version that may be in some cache of the nextcloud text editor (or somewhere else).

Installation method

Other

Operating system

Other

PHP engine version

Other

Web server

Other

Database engine version

No response

Is this bug present after an update or on a fresh install?

No response

Are you using the Nextcloud Server Encryption module?

No response

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

No response

List of activated Apps

I don't have access to the command-line

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

hosted by webo.hosting

@niowniow niowniow added 0. Needs triage bug Something isn't working labels May 12, 2022
@szaimen szaimen transferred this issue from nextcloud/server May 12, 2022
@mejo-
Copy link
Member

mejo- commented Nov 1, 2022

Dear @niowniow, thanks for your report. I was able to reproduce the behaviour that you describe.

The problem is that the editor session of the shared file is not cleaned up when closing the tab. So when opening the share link again fast enough (with the file having been altered via file sync in the meantime), the version from the session and the file as stored in Nextcloud differ and the conflict dialog is displayed.

We definitely should improve user experience here. I wonder whether we could detect that the file in session had been written to the filesystem and thus any subsequent changes are legit newer versions of the file.

@max-nextcloud as you're working on this field at the moment.

@juliusknorr
Copy link
Member

Code wise this seems to be related to the check to only reset the document when no active sessions are there in

$this->sessionService->removeInactiveSessions($file->getId());
$activeSessions = $this->sessionService->getActiveSessions($file->getId());
if ($forceRecreate || count($activeSessions) === 0) {
try {
$this->documentService->resetDocument($file->getId(), $forceRecreate);

@s4069b

This comment was marked as duplicate.

@meonkeys

This comment was marked as resolved.

@UllisHellfireeXperiments
Copy link

UllisHellfireeXperiments commented Dec 10, 2023

The same behavior is observable also when changing a file with the Notes app, with the same message being issued by the Text Editor afterwards: "The document has been changed outside of the file editor. The changes cannot be applied."

@max-nextcloud max-nextcloud changed the title [Bug]: Shared text file is not up-to-date with saved file [Bug]: Read only shared text file is not up-to-date with saved file Jul 10, 2024
@max-nextcloud
Copy link
Collaborator

Idea: When connecting to a read only document:

  • check if there is an exising editing session
  • if there is one connect to it
  • otherwise render the content statically and check back a minute later.

@juliusknorr juliusknorr moved this from 🧭 Planning evaluation (don't pick) to 🏗️ In progress in 📝 Office team Jul 10, 2024
@juliusknorr juliusknorr moved this from 🏗️ In progress to 📄 To do (~10 entries) in 📝 Office team Jul 10, 2024
@max-nextcloud max-nextcloud moved this from 📄 To do (~10 entries) to 🏗️ In progress in 📝 Office team Jul 16, 2024
@max-nextcloud
Copy link
Collaborator

For now #6094 fixes two related bugs:

  • Cleanup sessions for plain text documents if the file was overwritten.
  • Hide conflict dialogue in read only mode.

This does not get us all the way there - as the content is not automatically updated.
But at least it gets rid of the unusable conflict resolution dialogue.
If there's an actual conflict there's not much we can do - but if there's none we at least display a Reload button now.

@github-project-automation github-project-automation bot moved this from 🏗️ In progress to ☑️ Done in 📝 Office team Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

7 participants