Projects:Prevent Unneeded Grid Requests&action/Technical Specs
There are two detected flows that result in duplicated requests to the datasource. For them to be reproduced, the selected record must not be in the first page returned by the datasource. More details here: https://docs.google.com/a/openbravo.com/document/d/1K3M8JRIeg0Wm9_yZrwoafaY2gvGQAIdPEDueWrHtDaQ/edit
Contents |
Pressing the Refresh button while in form view
Current behaviour
When a record located in the position #238 of the grid is refreshed being the form view visible, four requests are done to the datasource:
- One with _targetRecordId. Very slow, returns the whole page where the record is located in the database
- One filtering by id. Very fast, only returns the selected record
- A request for the first page (0-100)
- A request for the second page (101-200)
Intended behaviour
Only the request filtered by the id should be done. The record should be shown updated both in the form and in the view form.
To preserve old behavior of requesting the whole page after executing a process, the process should include refreshGrid
action. See more details.
Pressing the Refresh button while in grid view
Current behaviour
When a record located in the position #238 of the grid is refreshed being the grid view visible, three requests are done to the datasource:
- One with _targetRecordId. Very slow, returns the whole page where the record is located in the database
- A request for the first page (0-100)
- A request for the second page (101-200)
Intended behaviour
Only one request should be done. It will ask for one page. If the record was located in the local data in the position #x, then the request will ask for the page [#x-50, #x+50]. If there have been lots of changes in the server database it is possible that the selected record will not be returned in that page. In that case the record will be selected, otherwise it will be kept selected.