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

Bug 1856267: Fix crash (white screen) when cancel Pipeline Create with open sidebar #5918

Conversation

jerolimov
Copy link
Member

Fixes:
https://issues.redhat.com/browse/ODC-4275

Analysis / Root cause:
When creating a pipeline, open a sidebar and press cancel the Console "crashes" and shows just a white screen.

Cause is that the state was resetted and the pipeline was rendered without the required formik data.

Solution Description:
Deselected the task for the sidebar so that the sidebar content was not rerendered with missing informations.

Screen shots / Gifs for design review:
Before:
Screencast_08 07 2020_12:03:59 webm

After:
Screencast_08 07 2020_12:06:26 webm

Unit test coverage report:
No new tests, no test changed

Test setup:
When creating a pipeline, open a sidebar and press cancel the Console "crashes" and shows just a white screen.

  1. Install OpenShift Pipelines operator (tested with 1.0.1)
  2. Open the Developer perspective and select Pipeline from the navigation.
  3. Select "Create Pipeline"
  4. Select task "git-clone" from the task list
  5. Click on task "git-clone" to open the config sidebar on the right side
  6. Press cancel (on the bottom left) while the sidebar is open!

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

Comment on lines 84 to 87
setSelectedTask(null);
selectedTaskRef.current = null;
props.handleReset();
}, [props]);
Copy link
Contributor

Choose a reason for hiding this comment

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

why not destructure handleReset as well? Now useCallback dependency is on all the props instead of just being on handleReset?

Suggested change
setSelectedTask(null);
selectedTaskRef.current = null;
props.handleReset();
}, [props]);
setSelectedTask(null);
selectedTaskRef.current = null;
handleReset();
}, [handleReset]);

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 Done

@jerolimov jerolimov force-pushed the fix-crash-when-closing-pipeline-create branch from 859ceb8 to fbf4052 Compare July 8, 2020 10:56
Copy link
Contributor

@sahil143 sahil143 left a comment

Choose a reason for hiding this comment

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

/lgtm

verified locally. works as expected.

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 8, 2020
Copy link
Contributor

@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.

/assign

LGTM. Sad to have had this issue in the first place, but I think it's easier to back port this change than do the needed change (push the data into Formik). So I'll work on that in my cleanup validation PR once I find a moment to code again haha.

Comment on lines +84 to +85
setSelectedTask(null);
selectedTaskRef.current = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a fan of this solution. It looks wrong but it seems to be a fault of the way the Pipeline Builder was written by me back in 4.4. I think this is an okay solution to back port. In 4.6, I'll fix it another way in #4805 when I rebase it and clean it up.

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andrewballantyne, jerolimov, sahil143

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-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 8, 2020
@openshift-merge-robot openshift-merge-robot merged commit 116fd85 into openshift:master Jul 8, 2020
@spadgett spadgett added this to the v4.6 milestone Jul 8, 2020
@jerolimov jerolimov changed the title Fix crash (white screen) when cancel Pipeline Create with open sidebar Bug 1856267: Fix crash (white screen) when cancel Pipeline Create with open sidebar Jul 13, 2020
@openshift-ci-robot
Copy link
Contributor

@jerolimov: All pull requests linked via external trackers have merged: . Bugzilla bug 1856267 has been moved to the MODIFIED state.

In response to this:

Bug 1856267: Fix crash (white screen) when cancel Pipeline Create with open sidebar

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jerolimov
Copy link
Member Author

/cherry-pick release-4.5

@openshift-cherrypick-robot

@jerolimov: new pull request created: #5958

In response to this:

/cherry-pick release-4.5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/dev-console Related to dev-console lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants