When the plugin enables the initOnSelectionChanged configuration, executing both executeMethod and callCommand causes an infinite loop of execution

Do you want to: Ask a how-to question
Document Server version: 7.1.1
When I trigger the event initOnSelection Changed using the following code, the execute Method and call Command will loop infinitely.
Why is this happening? Is there any way to make them execute only once.

 window.Asc.plugin.init = function () {
      this.executeMethod(
        "GetCurrentContentControlPr", [], function (obj) {
          console.log("executeMethod");
        })

      this.callCommand(() => {
        console.log("callCommand");

      })
    }

Hello @yingyu

First of all, please note that you are using very outdated version of Document Server. I recommend updating it to the actual and checking the situation again.

In general, it is not quite clear what “initOnSelection Changed” event is? Can you share an example? This code solely as init runs with no issue on actual version of the editor.

Plugin API variations.initOnSelectionChanged
https://api.onlyoffice.com/docs/plugin-and-macros/structure/manifest/#variationsinitonselectionchanged

I have solved this problem and updated the version to 8.2.1. The new version does not have this bug.

Thanks for letting know. I guess I can close the topic as solved.