sibvisions / reactUI

A generic react UI for JVx applications.
Apache License 2.0
3 stars 2 forks source link

exception for an already closed dialog #491

Closed rjahn closed 4 months ago

rjahn commented 4 months ago

Use features/features, screen Contacts Error (DB). Select a record and an error popup is shown -> perfect. Close with X or OK and another error is shown:

Component with id 'JVxMobileDemo_DP1_E1' was not found!

This shouldn't happen. Network communication debug view shows multiple close requests:

image

Not sure why there are 2 close requests.

gimmixAT commented 4 months ago

I couldn't reproduce it in FF or Chrome but I added a check so the closeFrame request will be sent only once, when the dialog close handler is called multiple times for whatever reason. -> 98a6b28aa29a5e5f27a0599c1c95c6a4502eb681

rjahn commented 4 months ago

Chrome was my browser.

Above problem is fixed but the same problem occurs in Messages screen, button: Feedback Press X in popup and not OK.

After X -> error appears:

image

BUT be careful, this is a problem, but there is another hidden bug (maybe):

After closing the above error, the next click (e.g. Feedback button) sends a request to the server and server sends a valid response, but our UI does nothing. If you press the button again, everything is fine.

So, please check why the response isn't handled after the error was shown before fixing the error.

gimmixAT commented 4 months ago

@rjahn just to double check, is the response for the closeFrame request supposed to look like this:

[{"componentId":"Mes-TL","changedComponents":[{"~remove":"true","id":"IF3083"}],"name":"screen.generic","update":true,"home":false}]

especially that the id given in the ~remove doesn't relay to the componentId of the closed message

rjahn commented 4 months ago

the id is the "application global unique" identifier. Means an instance counter with a prefix. This id is used for layout handling and component caching. the componenentId is screen unique and an element gets the same componentId as good as possible, e.g. an editor for the same table column won't change its name, but the id will change every time a new instance will be created. The componentId is relevant for automatic tests because the element identification won't change. The id itself will change every time you open a screen or create a new instance of a specific component.

The reactUI should have a component cache and if the cache doesn't contain the component with given id (or componentId), it will be ignored. In this specific case, the IFxxx is an internal frame. The internal frame is not sent to the client in partial transfer mode. Only full mode will receive internal frames...

gimmixAT commented 4 months ago

There was an issue with reopening the same dialog which should be fixed now. As for the error message I still wasn't able to reproduce that, even in Chrome. Although I am wondering where the _M6 comes from. In the requests I can see it is mostly _M1 being used.

rjahn commented 4 months ago

_M6 looks like message 6 -> if M1, M2, M3, M4, M5 are not closed.

rjahn commented 4 months ago

M6 is the 6th message. I got the same message in my tests - after 6 times opening the same popup. I will check this on server-side because it looks like a server numbering problem!

Following occurs in my environment:

https://github.com/sibvisions/reactUI/assets/1307043/bac10525-824d-4a6c-8f7d-bccd1a08c5ea

(Ignore first press-button)

My source is still before your fix for this problem - only to show you what's happening in my browser. My primereact verson is 10.6.3, maybe things are different with 10.6.6?

rjahn commented 4 months ago

OK, the M6 is clear. If you press OK button, the message is removed on server-side and next message has the same name. If it's not possible to remove the message or an error occurs, the name can't be used and a new name is created. In my case: I pressed 5 times the X and the error occured. So message number was 6 because 5 messages were still "open".

rjahn commented 4 months ago

Works with your fix and primereact 10.6.6