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

chrome-extension: Kogito icon is not working correctly after using the browser "back" #130

Open
ljmotta opened this issue Mar 2, 2023 · 2 comments · May be fixed by apache/incubator-kie-tools#2134
Assignees
Labels
area:tools Issues affecting Apache KIE tooling projects type:bug Something is behaving unexpectedly

Comments

@ljmotta
Copy link

ljmotta commented Mar 2, 2023

The Kogito icon becomes inaccessible after using the browser "back" in a bpmn/dmn file in the bpmn/dmn chrome-extension. Also, opening a bpmn/dmn file after the browser "back" a second Kogito icon will appear.

cant.open.kogito.mp4

double.kogito.mp4
@ljmotta ljmotta added the type:bug Something is behaving unexpectedly label Mar 2, 2023
@tiagobento tiagobento added area:tools Issues affecting Apache KIE tooling projects and removed area:browser-extensions labels Apr 24, 2023
@yesamer
Copy link

yesamer commented Aug 2, 2023

It seems the bug is still present, but it's slightly different. Now, every time you go back, a new icon is added.

Screen.Recording.2023-08-02.at.10.10.49.mov

@kbowers-ibm
Copy link

kbowers-ibm commented Jan 31, 2024

As detailed above, the problem was two-fold:
Problem 1) The kogito icon was being rendered multiple times when the back button was pressed. This was happening because GitHub caches DOM structures between changes of history.
Solution 1) This has been addressed by adding a cleanup function in the utils.ts which removes any existing elements from the DOM before rendering new ones(which was already used elsewhere in the application to address this problem happening with other components).

Problem 2) The kogito icon was being rendered, but was un-interactable. This was happening due to an error where we were trying to "insertAdjacentHtml" to elements that hadn't been rendered yet.
Solution 2) Fixed by making the affected function async, and only attempt to render once the element was available. (Similar to the SingleEditorView.ts)

Bugs found while testing:
#899
#900

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:tools Issues affecting Apache KIE tooling projects type:bug Something is behaving unexpectedly
Projects
Status: 🧐 In Review
4 participants