-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
URL Incorrect path Issue #436
Conversation
Thanks for submitting your first pull request! You are awesome! 🤗 |
@itsmevichu Thanks for opening this PR! This fix doesn't address the underlying issue, where both the |
@JasonWeill Thanks for your quick response, I am seeing that both NotFoundHandler and LabHandler is invoked while accessing the bad URL, but the persisted state of the path_config is what causing the I suppose. |
I tested this with the following URLs locally, as documented here: https://jupyterlab.readthedocs.io/en/stable/user/urls.html
All loaded as expected. Incorrect paths, like by misspelling Great work @itsmevichu ! |
Thank you so much @JasonWeill 😉 |
This is now available in JupyterLab Server version 2.25.3: https://github.com/jupyterlab/jupyterlab_server/releases/tag/v2.25.3 Thanks again @itsmevichu for your contribution! |
#Issue No. JuyterLab-#12768
Solution:
This issue is because of directly referencing the dictionary object instead of creating a copy in Python. This leads to unintended shared state, where modifications made to the dictionary in one part of the code affect other references to the same dictionary object.
jupyterlab_server/jupyterlab_server/handlers.py
Line 182 in 8b8182d
This makes a direct access to the page_config dictionary object, meaning that appending the notFoundUrl to this page_config persists throughout the instance. As a consequence, accessing the correct URL after this operation continues to trigger the same error mentioning the same path which is captured while accessing the wrong path.
jupyterlab_server/jupyterlab_server/handlers.py
Line 183 in 8b8182d
So, creating a shallow copy of the object fixes this issue.👇
jupyterlab_server/jupyterlab_server/handlers.py
Line 182 in 3be24ab