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

Fix onlyoffice behavior #4138

Merged
merged 6 commits into from
Oct 9, 2023
Merged

Fix onlyoffice behavior #4138

merged 6 commits into from
Oct 9, 2023

Conversation

nono
Copy link
Member

@nono nono commented Sep 26, 2023

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.

nono added 4 commits October 2, 2023 12:36
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.
docs/office.md Outdated Show resolved Hide resolved
model/office/file_by_key.go Show resolved Hide resolved
model/office/file_by_key.go Outdated Show resolved Hide resolved
taratatach
taratatach previously approved these changes Oct 5, 2023
@@ -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}
Copy link
Contributor

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?

Copy link
Member

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.

Copy link
Member Author

@nono nono Oct 9, 2023

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?

Copy link
Contributor

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.
Copy link
Contributor

@cballevre cballevre left a 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 👌

@nono nono merged commit 4dbc8a6 into master Oct 9, 2023
6 checks passed
@nono nono deleted the fix-onlyoffice branch October 9, 2023 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants