SuccessChanges

Summary

  1. Json adapters: ignore inconsistent/obsolete selection events from UI (details)
Commit 9ce18601a9534f41c51369b7c970b50bcb703a41 by Beat Schwarzentrub
Json adapters: ignore inconsistent/obsolete selection events from UI
Some widgets have a "selection" state that is synchronized with the UI
via events:
- JsonTable --> selected rows
- JsonTree --> selected nodes
- JsonPlanner --> selected resources
- JsonTileGrid --> selected tiles
In the JSON protocol, the selectable elements are referenced by IDs that
are managed by the corresponding JSON adapter. In some rare cases it is
possible the the UI receives a selection that contains (now) invalid IDs
that can no longer be resolved. If those cases are not handled properly,
the state on the UI (browser) and the UI server can diverge, which can
lead to further errors.
This change detects certain edge cases and ignores obsolete events.
Partly invalid selections are sent back to the UI.
Detailed problem description for tables:
----------------------------------------
When a form is stored and closed, it is possible that the table page is
automatically reloaded when the desktop is activated (via data change
listener). For a short period, the user may click another table row,
while the data is reloaded (busy indicator is not yet active). This can
lead to an inconsistent state between UI server and UI:
- UI is waiting for a reply to the "desktop is now in foreground" event.
- The row selection event is queued, because another request is
currently in progress.
- When the data has finished loading, all table rows are deleted and
replaced with new table rows. All rowIds are new. The server also sent
a new selected row, which is selected by the UI.
- The queued selection event is now sent to the UI server, but it still
contains an old rowId. The UI server correctly filters this unknown
rowId.
- Because no row remains, the selection is cleared on the UI server.
The event filter prevents this new state to be propagated to the UI.
Therefore, the UI now has a different state (1 selected row) as the
UI server (0 selected rows).
Fix: Ignore events that contain _only_ invalid rowIds.
251131
[Backport from 10.0]
Change-Id: I401be7ac1a07bc5d28e301b898060716a29be5e8 Reviewed-on:
https://git.eclipse.org/r/156262 Tested-by: CI Bot Reviewed-by: Beat
Schwarzentrub <bsh@bsiag.com>
The file was modifiedorg.eclipse.scout.rt.ui.html/src/main/java/org/eclipse/scout/rt/ui/html/json/tile/JsonTileGrid.java
The file was modifiedorg.eclipse.scout.rt.ui.html/src/main/java/org/eclipse/scout/rt/ui/html/json/basic/planner/JsonPlanner.java
The file was modifiedorg.eclipse.scout.rt.ui.html.test/src/test/java/org/eclipse/scout/rt/ui/html/json/testing/JsonTestUtility.java
The file was modifiedorg.eclipse.scout.rt.ui.html/src/main/java/org/eclipse/scout/rt/ui/html/json/table/JsonTable.java
The file was modifiedorg.eclipse.scout.rt.ui.html/src/main/java/org/eclipse/scout/rt/ui/html/json/tree/JsonTree.java
The file was modifiedorg.eclipse.scout.rt.ui.html.test/src/test/java/org/eclipse/scout/rt/ui/html/json/tile/JsonTileGridTest.java
The file was modifiedorg.eclipse.scout.rt.ui.html.test/src/test/java/org/eclipse/scout/rt/ui/html/json/basic/planner/JsonPlannerTest.java
The file was modifiedorg.eclipse.scout.rt.ui.html.test/src/test/java/org/eclipse/scout/rt/ui/html/json/tree/JsonTreeTest.java
The file was modifiedorg.eclipse.scout.rt.ui.html.test/src/test/java/org/eclipse/scout/rt/ui/html/json/table/JsonTableTest.java