How can I determine whether a callback triggered by autosave or edit end

Dear OnlyOffice Team,

I’m encountering an issue and would appreciate your guidance: How can I determine whether a callback triggered by OnlyOffice is initiated after all users exit editing or is an automatic save?

The reason for distinguishing these scenarios is that I need to save user input periodically (every few minutes) while also generating a new version only after all users finish editing. Through research, I found these resources:

I learned that enabling services.CoAuthoring.autoAssembly = true should theoretically trigger periodic callbacks. However, this raises a new challenge: How do I differentiate between callbacks triggered by autoAssembly versus those triggered by users closing the editor? I require this distinction to apply different business logic for each case.

After reviewing the official documentation:

I could not find any method to distinguish between these two callback types.

Looking forward to your response.

---------------- The above content was translated via DeepSeek. Original text -------------------

Hi OnlyOffice 的朋友:

我遇到了一个问题不知道如何解决:如何判断 OnlyOffice 发起的 callback 的触发场景,是用户都退出编辑后发起的还是自动自动保存发起的?

之所以需要区分主要是我期望每隔几分钟保存一次用户的输入结果,并且当所有用户都完成编辑之后生成新版本。 我通过搜索,在网上找到了资料:

进而知道了可以通过设置: **services.CoAuthoring.autoAssembly = true ** 启用这个功能,这样理论上来说会周期性的触发 callback。 但这样就
面临一个问题:如何区分是 autoAssembly 触发的 callback 还是用户完成编辑器后触发的? 我需求区分这两者做不同的业务处理。 我翻阅了官方文档:

没有找到如何区分这两者。

期待您的回复。

Hello @isNaN

When autoAssembly is set and timer is triggered, Document Server will send status 6 (forcesave) with forcesavetype status 0 or 2.
When all users closed the document and session has terminated, Document Server sends status 2.

Basically, you have to manage the messages from the callback of your app according to your design.
I hope it clarifies the situation.