Meet strange problem with Excel addin. Having two parallel sessions in a single file on SharePoint and Addin activated in both:
in the first session, the addin recreates (deletes and then adds) the worksheet, then creates a table there and fills it with data. at the 'add rows' step the addin in second session disappears without any errors reported in the console.
With javascript console, breakpoints and some 'await context.sync();' we found, that recreating worksheet, adding table and defining table headers passes normally, but after 'table.rows.add(0 , data['data']);' the addin in second session disappears.
found no keys to solve this issue. I.e. disabling events in the second session doesn`t help. This behavior is a big problem, because when addin disappears - all registered events stop to work too (shared javascript runtime is enabled).
how this behavior could be explained and fixed?
Reproducing is simple: open same doc on two pages, then activate script lab in both (no matter if script itself is executed or not). Then click 'Run' at the executed one. Here is the gist: https://gist.github.com/ASamSam/ad3c7717988628d6a361018205cef0ea
after clicking the button in executed script - script lab in second page will disappear. If several addons (our own in my eample) activated - all will disappear