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
Notification initialisation is not properly working #6178
Comments
I can reproduce your issue but not what you reported about the cause, specifically |
Nevermind, the import panel as pn
import hvplot.pandas # Initializes the extension once
pn.extension(notifications=True) |
With the following you should be able to reproduce it:
Then open up jupyter lab, create a new notebook, paste the code and execute |
To add to your question, Assuming that is the case, looking at the code in nb_loaded = published = getattr(self, '_repeat_execution_in_cell', False) |
The real issue seems to be that when the cell executes for the first time the Jupyter comm machinery does not seem to be fully set up, so while the |
I've figured out the issue. On first load BokehJS and Panel.JS aren't initialized yet and these take a while to load. However on the server side we don't know this so we instantiate the Comm that will be used to send data to the frontend. However if you attempt to initialize a Comm that hasn't yet been set up on the frontend it will never connect, so we end up in a scenario where even once everything is initialized any Comm that was set up before the frontend was fully initialized will not receive messages correctly. Will have to see if there's some way around this, but it's sadly not a simple problem. |
In Jupyter Lab (version 4.0.9), I tried to use panel notifications, like:
The strange thing was that on the first time, the notification did not appear, but every time afterwards, the notification did appear. I produced this issue using the official docker image (quay.io/jupyter/minimal-notebook) and installed panel (1.3.6) via pip.
I eventually found the issue by debugging cell execution twice. During the first execution of pn.extension() and the second execution I found a difference: It appeared that panel_extension._display_globals in panel.config is not called the first time but only the second time. I presume this should not be the case?
To verify, I added
panel_extension._display_globals()
manually after loading the extension, which resolved the issueFor completion, here is also some system context:
The text was updated successfully, but these errors were encountered: