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

Add a trigger for saving OO documents #3751

Closed
wants to merge 1 commit into from
Closed

Add a trigger for saving OO documents #3751

wants to merge 1 commit into from

Conversation

nono
Copy link
Member

@nono nono commented Feb 15, 2023

When a document is edited with OnlyOffice, the OnlyOffice server keeps a cache of the document and will send the document to save to the stack only if the user asks for a forcesave (ctrl-s shortcut), or after some time with no tab opened on the document. In our experience, it can be long and the users can expect the document to be saved to the VFS, and then synchronized via the sharings / desktop, but OO still has the document in its cache and doesn't send the save.

So, we decided to add a new trigger that will ask the OO server to forcesave often to ensure a better synchronisation between OO and the Cozy.

When a document is edited with OnlyOffice, the OnlyOffice server keeps a
cache of the document and will send the document to save to the stack
only if the user asks for a forcesave (ctrl-s shortcut), or after some
time with no tab opened on the document. In our experience, it can be
long and the users can expect the document to be saved to the VFS, and
then synchronized via the sharings / desktop, but OO still has the
document in its cache and doesn't send the save.

So, we decided to add a new trigger that will ask the OO server to
forcesave often to ensure a better synchronisation between OO and the
Cozy.
if err != nil {
return err
}
return sched.AddTrigger(t)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we check if a trigger already exists to avoid creating multiple triggers in case a document is opened in multiple tabs?

if _, err := GetStore().GetDoc(inst, msg.Key); err != nil {
// By returning the ErrBadTrigger code, the stack will know that it
// must delete the trigger.
return job.ErrBadTrigger{Err: err}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this how the trigger will be removed once the user is done editing?

@nono
Copy link
Member Author

nono commented Sep 26, 2023

This PR has some strong drawbacks, and a new way has been prefered: #4138

@nono nono closed this Sep 26, 2023
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.

2 participants