Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notebook After uninstallation, the api is still called in the background #259

Open
chenjpu opened this issue Jul 5, 2024 · 7 comments
Open
Labels
bug Something isn't working

Comments

@chenjpu
Copy link
Contributor

chenjpu commented Jul 5, 2024

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

  1. Go to '...'
  2. Click on '...'
  3. Scroll down to '...'
  4. See error '...'

Expected behavior

Context

  • Datalayer version:
  • Operating System and version:
  • Browser and version:
Browser Output

image

image

@chenjpu chenjpu added the bug Something isn't working label Jul 5, 2024
@echarles
Copy link
Member

echarles commented Jul 5, 2024

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

@chenjpu
Copy link
Contributor Author

chenjpu commented Jul 5, 2024

using the simple Notebook component

use nextjs router(Only one page contains the Notebook component)

@chenjpu
Copy link
Contributor Author

chenjpu commented Jul 8, 2024

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?

@chenjpu
Copy link
Contributor Author

chenjpu commented Jul 10, 2024

@echarles

if (children.isAttached || children.node.isConnected) {
children.dispose();
Widget.detach(children);
}
} catch (e) {
// no-op.
// console.debug('Exception while detaching Lumino widget.', e);
}

When the component is unloaded, the children.node.isConnected=false, lead to an exception. Does it have anything to do with this?

@echarles
Copy link
Member

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.

@chenjpu
Copy link
Contributor Author

chenjpu commented Jul 11, 2024

Fix keydown Event leak(#265)

@chenjpu
Copy link
Contributor Author

chenjpu commented Jul 11, 2024

@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 :(
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants