My new plugin is doing some long async extraction work under editDocument()
(sometimes taking several seconds), creating and deleting text/rectangle nodes, writing files, etc., and I discovered to my surprise/horror , that XD will actually call the (panel) pluginās update()
during this process.
I.e., itās treating the plugin as re-entrant, which it most certainly isnāt (donāt think any plugin is ready for that). React, in particular, is unhappy about this situation.
I worked around it by setting a guard bool during the editDocument()
, and dismissing immediately any attempts at re-entry via update()
.
But I claim this is either a bad bug or a design flaw: you canāt expect a panel plugin to handle an update()
when itās in the middle of a promise-based editDocument()
process.
(@kerrishotts or @peterflynn would be likely candidates to respondā¦)