jupyterlab_server icon indicating copy to clipboard operation
jupyterlab_server copied to clipboard

notFoundUrl pageConfig persisted

Open mbektas opened this issue 1 year ago • 1 comments

Description

notFoundUrl resent to browser with pageConfig with every JupyterLab load.

Reproduce

  • Hit a non-existing path like: http://localhost:8000/user/test/lab/some-path
  • Hit JupyterLab URL as usual (http://localhost:8000/user/test/lab/)

Expected behavior

  • Error message should be shown possibly once, and only if the non-existing URL was the initial JupyterLab URL being loaded.

Context

JupyterLab 3.4.8

Hi, while debugging some JupyterLab Desktop issues related to new features I am developing, I realized that jupyter server keeps returning previously not found URLs as part of pageConfig and that results in a dialog with the error message as shown below. If user mistakenly types an invalid path, this message would be shown at every JupyterLab reload since pageConfig persists the notFoundUrl config.

It seems to be caused by this line: https://github.com/jupyterlab/jupyterlab_server/blob/4263852881fd2bd181712dcabac1bda176886cd5/jupyterlab_server/handlers.py#L166

Also, if the non-existing path is part of initial URL entry then the popup is shown at that particular JupyterLab load. However, if the path was requested by javascript via fetch for example, then the popup will be shown at the subsequent JupyterLab loads, if any. The way I discovered the issue was, I opened dev tools and it requested source map file but couldn't load due to desktop app specific reasons, and next time I loaded JupyterLab it showed this "Path Not Found" error message.

I guess a solution could be to set page_config["notFoundUrl"] only for the initial JupyterLab URL load, if that was possible to detect.

jlab server path not found

mbektas avatar Oct 10 '22 19:10 mbektas

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

welcome[bot] avatar Oct 10 '22 19:10 welcome[bot]