jupyter-ui
jupyter-ui copied to clipboard
Notebook After uninstallation, the api is still called in the background
Using nextjs technology to integrate Notebook, when the navigation leaves the Notebook edit page, the api background continuously access。 When navigate to the Notebook edit page again, the shortcut keys all fail。
Description
Reproduce
- Go to '...'
- Click on '...'
- Scroll down to '...'
- See error '...'
Expected behavior
Context
- Datalayer version:
- Operating System and version:
- Browser and version:
Browser Output
Hi @chenjpu Are you using the simple Notebook component or the more evolved JupyterLabApp component?
How do you navigate away? (maybe the Notebook component is still rendered but not shown?)
using the simple Notebook component
use nextjs router(Only one page contains the Notebook component)
Force to refresh the browser, and the background api access stops. Is it the resource leakage caused by the service when the components are uninstalled?
@echarles https://github.com/datalayer/jupyter-ui/blob/53f2cd655c5fff4ef7772cef003ddbd86e4b85b5/packages/react/src/components/lumino/Lumino.tsx#L30-L37
When the component is unloaded, the children.node.isConnected=false, lead to an exception. Does it have anything to do with this?
When the component is unloaded, the children.node.isConnected=false, lead to an exception. Does it have anything to do with this?
That could be the case. that exception is coming from Lumino and hard to remove (ideally it should be).
Maybe a temp workaround, a termination action on the Notebook hook could help.
Fix keydown Event leak(https://github.com/datalayer/jupyter-ui/pull/265)
@echarles
useEffect(() => {
return () => {
try {
kernelManager?.dispose();
serviceManager?.dispose();
} catch (e) {
//console.log(e)
}
};
}, [serviceManager, kernelManager]);
Clear some api calls, but there are still some other apis rotation :(