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 tree view - reveal not to invalidate item command #8922

Merged
merged 1 commit into from
Jan 22, 2021
Merged

fix tree view - reveal not to invalidate item command #8922

merged 1 commit into from
Jan 22, 2021

Conversation

amiramw
Copy link
Member

@amiramw amiramw commented Jan 5, 2021

Signed-off-by: Amiram Wingarten [email protected]

What it does

The issue is a regression introduced in #8783
Calculation of parent chain (for id calculation) calls getChildren which dispose nodes.
This means that reveal for a node that is already revealed dispose the node and so the frontend has an id that doesn't exist in the backend anymore so tree item command is not found.

The fix is to check the cache before calling getChildren and making sure that the technical root is also in the cache.

How to test

  1. Install vsix from https://marketplace.visualstudio.com/items?itemName=SAPSE.sap-ux-application-modeler-extension
  2. Copy to workspace the attached project: project1.zip
  3. cd project1 && npm i
  4. Open Explorer view -> Application Modeler section and select on of the pages. It should open in code editor.
  5. Select the other page and it also opens in code editor in separate tab. Without this PR it doesn't open and there is an exception in browser console about command NOT FOUND.

Review checklist

Reminder for reviewers

The issue is a regression introduced in #8783
Calculation of parent chain (for id calculation) calls getChildren which dispose nodes.
This means that reveal for a node that is already revealed dispose the node and so the frontend has an id that doesn't exist in the backend anymore so tree item command is not found.

The fix is to check the cache before calling getChildren and making sure that the technical root is also in the cache.

Signed-off-by: Amiram Wingarten <[email protected]>
@amiramw
Copy link
Member Author

amiramw commented Jan 21, 2021

@kittaakos can you please review this fix?

Copy link
Contributor

@kittaakos kittaakos left a comment

Choose a reason for hiding this comment

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

I have verified the steps, it worked. 👍 Thank you!

@amiramw amiramw merged commit 4204297 into master Jan 22, 2021
@github-actions github-actions bot added this to the 1.10.0 milestone Jan 22, 2021
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