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 computation error on disclosure (take 2 πŸ™ˆ) #461

Merged
merged 2 commits into from
Jul 19, 2022

Conversation

alex-ju
Copy link
Member

@alex-ju alex-ju commented Jul 18, 2022

πŸ“Œ Summary

Fix computation error on disclosure utility component.

πŸ› οΈ Detailed description

In #456 I wrongly identified the issue – the solution made the cloud-ui tests pass, but only sometimes. After managing to replicate the failing tests locally and testing with https://github.com/hashicorp/cloud-ui/pull/3098 it turns out the racing happens between the @action functions (onFocusOut, onKeyUp) triggering the same notifyPropertyChange via close in a short amount of time (even shorter in automated tests). I tried many options to prevent this error from happening in tests without avail. The only solution I could find that prevents tests in cloud-ui from failing intermittently is to move what happens in the close function to the next runloop – hence I'm proposing this to unblock the adoption of this component until a wiser solution may be determined.


Preview

Failing/flaky test in HCP consul

Before

Screenshot 2022-07-18 at 18 14 40

After

Screenshot 2022-07-18 at 18 11 33

πŸ‘€ How to review

πŸ‘‰ Review by files changed

Reviewer's checklist:

  • +1 Percy if applicable
  • Confirm that PR has a changelog update via Changesets if needed

πŸ’¬ Please consider using conventional comments when reviewing this PR.

@changeset-bot
Copy link

changeset-bot bot commented Jul 18, 2022

πŸ¦‹ Changeset detected

Latest commit: 71465b3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hashicorp/design-system-components Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jul 18, 2022

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Updated
hds-components βœ… Ready (Inspect) Visit Preview Jul 19, 2022 at 6:09PM (UTC)
hds-flight-website βœ… Ready (Inspect) Visit Preview Jul 19, 2022 at 6:09PM (UTC)

@alex-ju alex-ju marked this pull request as draft July 18, 2022 17:16
@alex-ju alex-ju force-pushed the alex-ju/fix-computation-error-on-disclosure-2 branch 2 times, most recently from 639fb83 to dddbf0c Compare July 18, 2022 17:39
@vercel vercel bot temporarily deployed to Preview – hds-components July 18, 2022 17:40 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-flight-website July 18, 2022 17:41 Inactive
@alex-ju alex-ju force-pushed the alex-ju/fix-computation-error-on-disclosure-2 branch from dddbf0c to 093595b Compare July 19, 2022 07:15
@vercel vercel bot temporarily deployed to Preview – hds-flight-website July 19, 2022 07:16 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-components July 19, 2022 07:17 Inactive
@alex-ju alex-ju force-pushed the alex-ju/fix-computation-error-on-disclosure-2 branch from 093595b to 4a39977 Compare July 19, 2022 09:28
@vercel vercel bot temporarily deployed to Preview – hds-flight-website July 19, 2022 09:29 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-components July 19, 2022 09:29 Inactive

export default class HdsDisclosureComponent extends Component {
@tracked isOpen; // notice: if in the future we need to add a "@isOpen" prop to control the status from outside (eg to have the Disclosure opened on render) just add "this.args.isOpen" here to initalize the variable
@tracked toggleRef;
@tracked isToggleClicked;
Copy link
Member Author

@alex-ju alex-ju Jul 19, 2022

Choose a reason for hiding this comment

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

This is a leftover from an old refactoring – not used anywhere across the repo.

@alex-ju alex-ju marked this pull request as ready for review July 19, 2022 09:36
Copy link
Contributor

@didoo didoo left a comment

Choose a reason for hiding this comment

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

I don't see anything on my side, but I am not an Ember expert, so I would suggest to ask an extra couple of people with strong Ember background for review (or even better, post the PR in the #tech-frontend Slack channel for second opinions).

@alex-ju alex-ju force-pushed the alex-ju/fix-computation-error-on-disclosure-2 branch from 4a39977 to 91ce0da Compare July 19, 2022 09:50
@vercel vercel bot temporarily deployed to Preview – hds-flight-website July 19, 2022 09:52 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-components July 19, 2022 09:52 Inactive
@alex-ju alex-ju force-pushed the alex-ju/fix-computation-error-on-disclosure-2 branch from 91ce0da to f9b38f4 Compare July 19, 2022 12:29
@vercel vercel bot temporarily deployed to Preview – hds-flight-website July 19, 2022 12:31 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-components July 19, 2022 12:31 Inactive
@alex-ju alex-ju force-pushed the alex-ju/fix-computation-error-on-disclosure-2 branch from f9b38f4 to 143b7b6 Compare July 19, 2022 12:45
@vercel vercel bot temporarily deployed to Preview – hds-flight-website July 19, 2022 12:47 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-components July 19, 2022 12:47 Inactive
@alex-ju alex-ju force-pushed the alex-ju/fix-computation-error-on-disclosure-2 branch from 143b7b6 to 2706b9f Compare July 19, 2022 17:55
@vercel vercel bot temporarily deployed to Preview – hds-flight-website July 19, 2022 17:56 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-components July 19, 2022 17:57 Inactive
@didoo didoo self-requested a review July 19, 2022 18:06
Copy link
Contributor

@didoo didoo left a comment

Choose a reason for hiding this comment

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

OK for me

@alex-ju alex-ju force-pushed the alex-ju/fix-computation-error-on-disclosure-2 branch from 2706b9f to 71465b3 Compare July 19, 2022 18:08
@vercel vercel bot temporarily deployed to Preview – hds-components July 19, 2022 18:09 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-flight-website July 19, 2022 18:09 Inactive
@alex-ju alex-ju merged commit e1f94bc into main Jul 19, 2022
@alex-ju alex-ju deleted the alex-ju/fix-computation-error-on-disclosure-2 branch July 19, 2022 18:14
@hashibot-hds hashibot-hds mentioned this pull request Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants