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

Suppress 404 error for notebook route when the notebook is not running #989

Merged

Conversation

DaoDaoNoCode
Copy link
Member

@DaoDaoNoCode DaoDaoNoCode commented Mar 3, 2023

Description

Closes #858

How Has This Been Tested?

There is no good way to test it because once you delete the route, it will recreate one immediately before re-fetching it. I tested it by changing the notebookName to something else, which will give you a 404 error when you are trying to get the route, but the isRunning status is always accurate. In this way, I can toggle the switch and see if the error is set or not when based on the notebook status.

Merge criteria:

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

@Gkrumbach07
Copy link
Member

Gkrumbach07 commented Mar 7, 2023

I created a way to force a 404 error. In the old implementation, 404 would persist even while loading. In the new implementation there is no error until loaded.

I had concerns about setting error to null everytime being unnessary

if (!isRunning && e.statusObject?.code === 404) {
    setLoadError(null);
}

But in the case where there was an error while running, and the user stops and starts again, the error wont go away until a successful call is made. So no issue there. unless it would be desired to keep the error after it has been shut down (doubt it is so lgtm).

/lgtm

Copy link
Contributor

@lucferbux lucferbux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Copy link
Member

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should help with the optics of what is going on during the load. Either way, when the route eventually comes back it should reset to being active (previous functionality). Good improvement for the meantime.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 9, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andrewballantyne, Gkrumbach07, lucferbux

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Mar 9, 2023
@openshift-merge-robot openshift-merge-robot merged commit 6b08849 into opendatahub-io:main Mar 9, 2023
lucferbux pushed a commit to lucferbux/odh-dashboard that referenced this pull request Mar 13, 2023
strangiato pushed a commit to strangiato/odh-dashboard that referenced this pull request Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Improve Error Handling of useRouteForNotebook
5 participants