I can confirm this. I’m not quite sure about “won’t be an issue when the plugin is deployed”, though. It won’t consistently break the plugin once deployed, but I’ve had several weird crashes that weren’t reproducible but seemed to correlate with using InDesign event listeners. I suspect this also played a role in
I can confirm that it consistently happens when rebuilding the plugin, though.
I’m currently replicating this kind of functionality (in all of my InDesign-based projects) to re-evaluating any dynamic state on a setInterval()
loop. Far from ideal, but the only way I found that doesn’t seem to increase InDesign crashes (or at least: not significantly enough to confirm it during my tests).
Overall (and this isn’t just limited to events), InDesign seems to become unstable when more complex event loop interactions take place between UXP and InDesign APIs. This also, for example, affects interactions between app.doScript()
and promises / async operations. Definitely something Adobe needs to fix if they want UXP to be a viable option for broader InDesign extensibility.