Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

fix(tree-view): error EHCAIWC for lazy expandable nodes #5945

Merged
merged 1 commit into from May 19, 2021

Conversation

bbogdanov
Copy link
Contributor

The main reason for EHCAIWC was that in this function the Promise or the Observable can be resolved too quickly and the loading property value can be changed before the next change detection cycle.

I'm resolving the issue with a pattern we used for the datagrid selection that in first case it was producing a EHCAIWC, then we did a fix and the fix was skipping a change detection cycle and we end up with out last solution that seems to be the best one so far.

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • If applicable, have a visual design approval

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • clarity.design website / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #5927

What is the new behavior?

EHCAIWC is not produced anymore.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

A way to see the issue is not available anymore is:

  1. Go to the dev app
  2. Navigate to tree-view
  3. Select the Lazy recursive tree
  4. Expand on item from the Asynchronous, loading exactly what's visible example
  5. Take a look at the console for EHCAIWC error

@vmwclabot
Copy link

@bbogdanov, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <john.doe@email.org> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

Copy link
Contributor

@Jinnie Jinnie left a comment

Choose a reason for hiding this comment

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

Interesting approach. But I like it, because it handles the Angular lifecycle gently.

Closes vmware-archive#5927

The main reason for EHCAIWC was that [in this function](https://github.com/vmware/clarity/blob/next/packages/angular/projects/clr-angular/src/data/tree-view/models/recursive-tree-node.model.ts#L46) the Promise or the Observable can be resolved too quickly and the `loading` property value can be changed before the next change detection cycle.

I'm resolving the issue with a pattern we used for the [datagrid selection](https://github.com/vmware/clarity/blob/next/packages/angular/projects/clr-angular/src/data/datagrid/providers/selection.ts#L164) that in first case it was producing a EHCAIWC, then we did a fix and the fix was skipping a change detection cycle and we end up with out last solution that seems to be the best one so far.

Signed-off-by: Bogdan Bogdanov <bbogdanov@vmware.com>
@bbogdanov bbogdanov merged commit 979dc14 into vmware-archive:next May 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recursive lazy-loaded TreeView clrExpandable causes an EHCAIWC error
4 participants