-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
fix(ui): Only redirect/reload to wf list page when wf deletion succeeds #11676
Conversation
Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
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.
Only 1 in-line comment related to the contents of this change.
I also see some potential issues in the surrounding code that could be root cause related
@@ -197,10 +197,12 @@ export const WorkflowDetails = ({history, location, match}: RouteComponentProps< | |||
if (isArchivedWorkflow(workflow) && (globalDeleteArchived || !isWorkflowInCluster(workflow))) { | |||
services.workflows.deleteArchived(workflow.metadata.uid, workflow.metadata.namespace).catch(setError); |
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.
I'm pretty sure that this line and the equivalent above are asynchronous promises. If they're not waited on to finish, the redirect and reload may happen before the request completes.
It is possible the requests get cancelled as a result of that, would need to see some traces to confirm that though (as it depends).
That could be the root cause here, but not really sure without looking in more detail
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.
Fixed in #11711
// TODO: This is a temporary workaround so that the list of workflows | ||
// is correctly displayed. Workflow list page needs to be more responsive. | ||
window.location.reload(); |
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.
a better workaround would be to reload only the list of workflows, i.e. have it refetch instead of reloading the entire window
if (error === null) { | ||
navigation.goto(uiUrl(`workflows/${workflow.metadata.namespace}`)); | ||
// TODO: This is a temporary workaround so that the list of workflows | ||
// is correctly displayed. Workflow list page needs to be more responsive. | ||
window.location.reload(); | ||
} |
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.
this if
statement could be inverted to remove nesting. same with the if (yes)
one above too
if (error === null) { | |
navigation.goto(uiUrl(`workflows/${workflow.metadata.namespace}`)); | |
// TODO: This is a temporary workaround so that the list of workflows | |
// is correctly displayed. Workflow list page needs to be more responsive. | |
window.location.reload(); | |
} | |
if (error !== null) { | |
return | |
} | |
navigation.goto(uiUrl(`workflows/${workflow.metadata.namespace}`)); | |
// TODO: This is a temporary workaround so that the list of workflows | |
// is correctly displayed. Workflow list page needs to be more responsive. | |
window.location.reload(); |
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.
Refactored in #11711
Potentially fix and surface the underlying issue in #11661.