Skip to content

Problem with synchronisation with spreadsheet聽#2941

Open

Description

@AIlkiv

Please use the 馃憤 reaction to show that you are affected by the same issue. Please don't comment if you have no relevant information to add!

Describe the bug

Continuation of the story #2165. I noticed that this does not always work.

To Reproduce

Steps:

  1. Open the file via richdocuments.
  2. Fill out the form.
  3. After completing the form, make changes to the open file and save.

Result: The last submission will be overwritten by the version from richdocuments.

Expected behavior

It will not allow saving in richdocuments. It will ask to download the updated version first.

Additional context

The solution I found:
In richdocuments, listen to PostWriteListener and if it is CLI, invalidate (delete) all tokens for this file.

Result: All users of the file will receive a message that they need to reload the page. They reload and get the latest version.

Disadvantage: If users had unsaved changes, they will be lost. In my opinion, this is less critical because the user will see that their connection has been lost and will understand that they need to check if all changes are there (plus richdocuments has auto-save, so the impact is minimal). Because now, when richdocuments overwrites Submission, there is no way to track it, and it causes a lot of problems.

Activity

  1. added
    bugSomething isn't working
    0. Needs triagePending approval or rejection. This issue is pending approval.
    on Sep 27, 2025
  2. added theissue type on Sep 27, 2025
  3. AIlkiv commented on Sep 27, 2025

    @AIlkiv
    CollaboratorAuthor

    @susnux @Chartman123 The bug is quite complex and my solution is not perfect. Therefore, I would appreciate your expert opinion.

  4. Chartman123 commented on Sep 30, 2025

    @Chartman123
    Collaborator

    @AIlkiv what about other office suites like OnlyOffice? the solution shouldn't be specific to Nextcloud Office/Collabora. Is there a way to try to obtain a file lock first and if it's already locked, we postpone the write job?

  5. AIlkiv commented on Oct 1, 2025

    @AIlkiv
    CollaboratorAuthor

    @AIlkiv what about other office suites like OnlyOffice? the solution shouldn't be specific to Nextcloud Office/Collabora. Is there a way to try to obtain a file lock first and if it's already locked, we postpone the write job?

    Richdocuments only locks the file during the saving process. As far as I know, locking the file for the entire time it is open is not an option, because the lock should not be applied to users (since collaboration should be possible), but to apps (for example, making the file locked for Collabora Online).

    But this solution also has its drawbacks: the user can simply open the file in a separate tab and keep it open all day, so the submission will not appear.


    The ideal solution would be if Collabora Online had an API that could be used to update the file if it is open (like when a user logs in to edit it). Then, at the Forms level, the export logic could be broken down into different providers. But I doubt that this will ever be possible.


    I understand what you mean, so my suggestion is to add this logic to richdocuments, not forms. Because it seems that it will also be useful for Nextcloud Flow or other modules that can modify the file. I don't work with OnlyOffice, but I can report it there so that they write their own listener.

  6. Chartman123 commented on Oct 1, 2025

    @Chartman123
    Collaborator

    But the linked document should at best never be edited manually as the sync job will overwrite the data at least in the first sheet. So users should make a copy of it and edit the copy. Everything else will nearly always lead to data loss...

  7. AIlkiv commented on Oct 11, 2025

    @AIlkiv
    CollaboratorAuthor

    @juliusknorr Perhaps you have ideas on how to best solve this problem on richdocuments?

  8. juliusknorr commented on Oct 16, 2025

    @juliusknorr
    Member

    Maybe an interesting one for @pedropintosilva from Collabora.

    There are APIs to transform documents however they currently would also have the same issue with editing conflicts or possible overriding of the files.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending approval or rejection. This issue is pending approval.bugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions