Hi all,
We've been experiencing an issue with BusyContext entries becoming stuck and not clearing.
Its been hard to replicate but in some scenarios where we have used a BusyContext check before performing an action (we have a few popups in the application that open once the Busy Context has resolved on an element), the BusyContext never resolves. Code example below:
self.openList = () => new Promise((resolve) => {
oj.Components.subtreeShown(document.getElementById(`list-${self.customId}`));
const listModule = document.getElementById(`list-${self.customId}`);
const busyContext = oj.Context.getContext(listModule).getBusyContext();
busyContext.whenReady().then(() => {
self.displayListSignal.dispatch(); // Signal dispatched to call relevant API and open dialog
resolve();
});
});
We have narrowed it down to a scenario that when you open a new tab that loads multiple different modules within it, but you close the tab too quickly before the modules inside have time to properly load. The errors below get thrown in the console, and we have entries in the BusyContext that don't clear until you refresh the browser window.

Doing a dump of the current busy context states before trying to open the popup gives the following (it never clears down).

The solution we have currently is that on the close event for a tab, we force a clear of the BusyContext (oj.Context.getPageContext().getBusyContext().clear()) and that seems to work. However, should these BusyContext items be getting stuck in the first place? Or is there a way to safely dispose of the modules when the tabs close prematurely to prevent these errors occurring the first place. The detached / dispose life cycle listeners don't seem to fire in this scenario either.
We are currently on JET v5, but working on upgrading to v7 in the coming weeks.
Cheers