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

fix(ui): Only redirect/reload to wf list page when wf deletion succeeds #11676

Merged
merged 1 commit into from
Aug 25, 2023

Conversation

terrytangyuan
Copy link
Member

Potentially fix and surface the underlying issue in #11661.

Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
Copy link
Member

@agilgur5 agilgur5 left a 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);
Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

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

Fixed in #11711

Comment on lines +202 to +204
// 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();
Copy link
Member

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

Comment on lines +200 to +205
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();
}
Copy link
Member

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

Suggested change
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();

Copy link
Member

Choose a reason for hiding this comment

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

Refactored in #11711

@terrytangyuan terrytangyuan merged commit f18b339 into argoproj:master Aug 25, 2023
22 checks passed
@terrytangyuan terrytangyuan deleted the list-err branch August 25, 2023 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants