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 1834774: Solve React warning when closing Traffic Splitting dialog #5406

Conversation

jerolimov
Copy link
Member

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

Analysis / Root cause:
"Can't perform a React state update" warning happend because the Dialog resets the formik state after unmounting it.

Solution Description:
Just close the dialog instead. Similar to some other modal dialogs, like:

https://github.com/openshift/console/blob/master/frontend/packages/dev-console/src/components/modals/EditApplicationModal.tsx#L61

Test setup:
Not changed a test

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

@openshift-ci-robot openshift-ci-robot added the bugzilla/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. label May 12, 2020
@openshift-ci-robot
Copy link
Contributor

@jerolimov: This pull request references Bugzilla bug 1834774, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1834774: Solve Warning when closing Traffic Splitting dialog

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.

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label May 12, 2020
@openshift-ci-robot openshift-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 12, 2020
@openshift-ci-robot
Copy link
Contributor

Hi @jerolimov. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@invincibleJai
Copy link
Member

/ok-to-test

@openshift-ci-robot openshift-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 12, 2020
@invincibleJai
Copy link
Member

/assign @invincibleJai

@invincibleJai
Copy link
Member

/retest

@jerolimov jerolimov force-pushed the fix-traffic-splitting-warning branch 3 times, most recently from 493c274 to e732c9e Compare May 12, 2020 12:52
@jerolimov jerolimov changed the title Bug 1834774: Solve Warning when closing Traffic Splitting dialog Bug 1834774: Solve React warning when closing Traffic Splitting dialog May 12, 2020
Comment on lines 11 to 14
interface TrafficSplittingModalProps {
revisionItems: RevisionItems;
cancel: () => void;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

we could extend the interface with the underlying ModalComponentProps which has these modal related props.

Suggested change
interface TrafficSplittingModalProps {
revisionItems: RevisionItems;
cancel: () => void;
}
interface TrafficSplittingModalProps {
revisionItems: RevisionItems;
}

@@ -10,12 +10,13 @@ import { RevisionItems } from '../../utils/traffic-splitting-utils';

interface TrafficSplittingModalProps {
revisionItems: RevisionItems;
cancel: () => void;
}

type Props = FormikProps<FormikValues> & TrafficSplittingModalProps;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
type Props = FormikProps<FormikValues> & TrafficSplittingModalProps;
type Props = FormikProps<FormikValues> & TrafficSplittingModalProps & ModalComponentProps;

Copy link
Member Author

@jerolimov jerolimov May 13, 2020

Choose a reason for hiding this comment

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

Interesting idea, I'll force push this, thanks 👍

@karthikjeeyar
Copy link
Contributor

/retest

@karthikjeeyar
Copy link
Contributor

Verified locally, i dont see the warnings anymore.
/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 13, 2020
"Can't perform a React state update" happend because the Dialog resets
the formik state after unmounting it. Just close it instead.
@jerolimov jerolimov force-pushed the fix-traffic-splitting-warning branch from 2d2517d to 052511d Compare May 13, 2020 22:28
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label May 13, 2020
@jerolimov
Copy link
Member Author

@karthikjeeyar Force pushed the changes with fixed commit email address.

@karthikjeeyar
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 15, 2020
@invincibleJai
Copy link
Member

/approve

Thanks @jerolimov , verified works as expected

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: invincibleJai, jerolimov, karthikjeeyar

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 May 18, 2020
@jerolimov
Copy link
Member Author

Flaky test (timeout)

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 79d6a6e into openshift:master May 18, 2020
@openshift-ci-robot
Copy link
Contributor

@jerolimov: All pull requests linked via external trackers have merged: openshift/console#5406. Bugzilla bug 1834774 has been moved to the MODIFIED state.

In response to this:

Bug 1834774: Solve React warning when closing Traffic Splitting dialog

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 jerolimov deleted the fix-traffic-splitting-warning branch May 18, 2020 12:26
@spadgett spadgett added this to the v4.5 milestone May 18, 2020
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. bugzilla/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/knative Related to knative-plugin lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants