sibvisions / reactUI

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

Console warnings with same screen #496

Closed rjahn closed 3 months ago

rjahn commented 4 months ago

User: features

Open Contacts (DB) Press Menu item again:

Console shows: Warning: Hash history cannot PUSH the same path; a new entry will not be added to the history stack

Select a record and press menu Item (Contacts (DB)) again:

Console shows:

Component 'name' is not unique (Con-CG_MP1_P1_P1) ...

This shouldn't happen because the previous screen should be closed and closing a screen removes component bindings?

gimmixAT commented 4 months ago

The way it works right now is that if a component is remove all children are marked as invalid but are still kept around and apparently never cleaned up. This causes the warning later on when multiple components exist in the store with the same name.

The invalid flag has been added here: https://github.com/sibvisions/reactUI/commit/05ddab7f5fac70cf1effcc822a6381e6413d6b81
So apparently before that child components just stuck around unless they were explicitly removed by the server

There are two ways I could mitigate this:

rjahn commented 4 months ago

If we remove a component, it's still possible to add it later. So caching "unused" components is correct. The server will send a ~destroy for components which can be removed from the cache. But this only happens if garbage collector removes such components.

Change logging is a good option and please check if ~destroy is implemented.

We should change server logic if necessary, but currently it's only a logging problem.

rjahn commented 4 months ago

I remember that there was a special remove logic on client in case of screen destroy/close? Is there some logic for caching components per screen and maybe the clear cache mechanism isn't working anymore?

gimmixAT commented 3 months ago

The warning is now only shown if another entry is found that is not invalid -> 624b58b324425b21564e9f1c33cf68c3a9b75a2d

~destroy seems to be implemented