-
-
Notifications
You must be signed in to change notification settings - Fork 334
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
Resolves chat panel initialization error #660
Conversation
Thanks for submitting your first pull request! You are awesome! 🤗 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you opening this PR! Once released, this will be super helpful to other users experiencing the same bug.
This PR is not yet complete however. The root issue is that the value of self.config.serverapp.jpserver_extensions
has a different type that depends on the environment for some reason. In some environments (like yours) it is an instance of dict
, but in others (like the CI pipeline) it is an instance of LazyConfigValue
. See these CI logs:
What's more bizarre is that the value of this LazyConfigValue
seems to differ depending on how it is accessed. Here are the logging statements I added to get_chat_user()
:
self.log.warning(self.config)
self.log.warning(self.config.ServerApp)
self.log.warning(self.config.ServerApp.jp_server_extensions)
self.log.warning(self.config.ServerApp.jp_server_extensions.get_value({}))
And here are the logs they yield:
[W 2024-03-05 10:30:38.298 ServerApp] {'NotebookApp': {}, 'ServerApp': {'jpserver_extensions': <LazyConfigValue value={'jupyterlab': True, 'jupyter_ai': True, 'jupyter_lsp': True, 'jupyter_server_terminals': True, 'notebook_shim': True}>, 'default_url': '/lab', 'open_browser': True, 'file_url_prefix': '/lab/tree', 'jp_server_extensions': <LazyConfigValue value={}>}}
[W 2024-03-05 10:30:38.298 ServerApp] {'jpserver_extensions': <LazyConfigValue value={'jupyterlab': True, 'jupyter_ai': True, 'jupyter_lsp': True, 'jupyter_server_terminals': True, 'notebook_shim': True}>, 'default_url': '/lab', 'open_browser': True, 'file_url_prefix': '/lab/tree', 'jp_server_extensions': <LazyConfigValue value={}>}
[W 2024-03-05 10:30:38.298 ServerApp] <LazyConfigValue value={}>
[W 2024-03-05 10:30:38.299 ServerApp] {}
Notice how line 2 implies a non-empty dict, but lines 3 and 4 imply an empty dict. 🤔
I'm going to pull in @Zsailer to see if he can offer some guidance on the best way of determining if jupyter_collaboration
is installed & enabled. There may be a better way that doesn't require accessing self.config.ServerApp.jp_server_extensions
directly, since that may be an internal jupyter_server
API.
Zach and I will get back to you on this, and I will open a PR against your PR. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@meeseeksdev please backport to 1.x |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
Disregard the above, that was done out of muscle memory, and this PR should not be backported. |
* Removed invalid ` get_value ` method for dictionary call * replaced jpserver_extensions with extension_manager API * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Removed invalid ` get_value ` method for dictionary call * replaced jpserver_extensions with extension_manager API * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Removes
get_value({})
inline of dictionaryget
method, unblocking chat panel initialization error:Tested against v2.10.0 in Jupyter Lab v4.1.2
Fixes #335