Is there a way to detect in a callback if a CommandsService was executed?

Hi everyone,

I’m currently working with OnlyOffice callbacks and facing the following issue:

I frequently need to fetch the current users. Every time I do this, the callback is triggered. Unfortunately, I cannot reliably tell within the callback where it was triggered from — specifically, whether it came from a CommandsService or not.

My current solution is to check if Actions is null in the callback. So far, this works quite well: whenever Actions is null, it usually indicates a callback from the CommandsService. However, there are sometimes callbacks with Actions = nullthat are simply irrelevant.

My question: is there a cleaner way to detect within the callback if a CommandsService was actually executed?

Thanks in advance for any help or tips!

Hello @parceval

Do I understand correctly that you are referring to Command Service?

Do you use info command for that?

Additionally, please let me know version of Document Server that is currently used.

Yes, exactly, I’m referring to the command service. I’m specifically using the Info command, and the documentation itself says that this triggers the callback. I’m also using OnlyOffice version 9.1.

userdata option of the info method has following description:

Defines some custom identifier which will help distinguish the specific request in case there were more than one.

Do you use it?