-
Notifications
You must be signed in to change notification settings - Fork 141
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
Fix onlyoffice behavior #4138
Fix onlyoffice behavior #4138
Conversation
When a new version of an office document is uploaded to a Cozy, the stack will now open this new version, even if the previous version of the document was already in the cache of OO. It was too confusing for the user that has uploaded a new version to not see their changes if they open the document in OO. If there was other users editing the document in OO, they will be alerted of the conflict by cozy-drive and can refresh their tab to see the new version. And if there were changes, they are not lost, but will be saved in a conflict document.
@@ -148,6 +155,7 @@ func saveFile(inst *instance.Instance, detector conflictDetector, downloadURL st | |||
newfile.UpdatedAt = time.Now() | |||
newfile.CozyMetadata.UpdatedAt = newfile.UpdatedAt | |||
newfile.CozyMetadata.UploadedAt = &newfile.UpdatedAt | |||
newfile.CozyMetadata.UploadedBy = &vfs.UploadedByEntry{Slug: OOSlug} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nono I think we have a problem here. From what I understood, the uploadedBy is only changed when the file is created. So after this route is called, its value always remains at {"slug": "onlyoffice-server" }
. For the front, it means that the modals are no longer displayed from this point. A more effective way would be to add an entry in updatedByApps and based the front on it. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the same way, CozyMetadata.UploadedAt
should not be modified either. We don't modify these two attributes when uploading a new version via Drive or Desktop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do modify these two attributes when a file is uploaded (creation or content modification). It's the stack that does the job. Is it OK for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I must have a bug in local, the stack does not modify the fields and it always remains in onlyoffice-server after a modification by OnlyOffice 🙁
When the content of a file is modified by uploading a new version of it, the cozyMetadata.uploaded* fields must be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its working as expected for me 👌
When a new version of an office document is uploaded to a Cozy, the
stack will now open this new version, even if the previous version of
the document was already in the cache of OO. It was too confusing for
the user that has uploaded a new version to not see their changes if
they open the document in OO. If there was other users editing the
document in OO, they will be alerted of the conflict by cozy-drive and
can refresh their tab to see the new version. And if there were changes,
they are not lost, but will be saved in a conflict document.