Can only safely run plugin code while in its own independent history batch

I see errors from users like “Can only safely run plugin code while in its own independent history batch”. What does it mean?
Stacktrace:
Stack: Error: Can only safely run plugin code while in its own independent history batch
at Object.execScenegraphEdit (plugins/ScenegraphGuard.js:1:4240)
at Object.t.editDocument (plugins/ApplicationWrapper.js:1:4768)

Hi @gdreyv,

That sounds worrisome, so I asked around.

This means that an edit batch is already in progress when plugin is trying to execute an action/command with editDocument. Perhaps there’s an nested editDocument? Or an action command is nested within another?

Let me know if that’s helpful or correct…