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
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