Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029835Openbravo ERPA. Platformpublic2015-05-11 09:312015-05-15 11:25
AugustoMauch 
AugustoMauch 
immediatemajorhave not tried
closedfixed 
5
 
3.0PR15Q3 
alostale
Core
Production - Confirmed Stable
2014-11-19
3.0PR15Q1
https://code.openbravo.com/erp/devel/pi/rev/3221fd5a8661d7f9dfbfd6d4255bace9834e6535 [^]
No
0029835: Unlimited grid datasource request under certain circumstances
If the user scrolls down a grid till reaching the second page, and then performs a filter that returns less than a page, the filtered records will be shown but an unlimited amount of grid requests will be done until the user closes the window.
- Open the Country and Region window
- Scroll down until you see Iraq
- Open the browser developer tools and select the Network tab
- Enter Q in the name filter editor
- The names that contain Q will be displayed, but the grid will show empty lines for more rows. Also, unlimited requests to the Country datasource will be done, you can check it in the developer tools
Performance
depends on backport 00298383.0PR15Q2.1 closed AugustoMauch Unlimited grid datasource request under certain circumstances 
depends on backport 00298393.0PR15Q1.4 closed AugustoMauch Unlimited grid datasource request under certain circumstances 
caused by design defect 0025811 closed AugustoMauch unnecessary request on grid refresh 
related to defect 0029896 closed AugustoMauch double grid request when filtering grid after scrolling to 2nd page 
Issue History
2015-05-11 09:31AugustoMauchNew Issue
2015-05-11 09:31AugustoMauchAssigned To => platform
2015-05-11 09:31AugustoMauchModules => Core
2015-05-11 09:31AugustoMauchRegression level => Production - Confirmed Stable
2015-05-11 09:31AugustoMauchRegression date => 2014-11-19
2015-05-11 09:31AugustoMauchRegression introduced in release => 3.0PR15Q1
2015-05-11 09:31AugustoMauchRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/3221fd5a8661d7f9dfbfd6d4255bace9834e6535 [^]
2015-05-11 09:31AugustoMauchTriggers an Emergency Pack => No
2015-05-11 09:40AugustoMauchRelationship addedcaused by 0025811
2015-05-11 10:19AugustoMauchStatusnew => scheduled
2015-05-11 10:31AugustoMauchIssue Monitored: alostale
2015-05-11 10:31AugustoMauchReview Assigned To => alostale
2015-05-11 10:31AugustoMauchDescription Updatedbug_revision_view_page.php?rev_id=8497#r8497
2015-05-11 10:54hgbotCheckin
2015-05-11 10:54hgbotNote Added: 0077267
2015-05-11 10:54hgbotStatusscheduled => resolved
2015-05-11 10:54hgbotResolutionopen => fixed
2015-05-11 10:54hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/28a52b693c8184ce50786122fbb88121eab85f46 [^]
2015-05-11 13:05AugustoMauchNote Added: 0077276
2015-05-11 21:53hudsonbotCheckin
2015-05-11 21:53hudsonbotNote Added: 0077314
2015-05-12 16:05AugustoMauchTag Attached: Performance
2015-05-13 10:00AugustoMauchNote Added: 0077367
2015-05-13 17:28alostaleAssigned Toplatform => AugustoMauch
2015-05-14 11:01alostaleNote Added: 0077434
2015-05-14 11:01alostaleStatusresolved => new
2015-05-14 11:01alostaleResolutionfixed => open
2015-05-15 09:04alostaleRelationship addedrelated to 0029896
2015-05-15 09:04alostaleStatusnew => scheduled
2015-05-15 09:04alostaleStatusscheduled => resolved
2015-05-15 09:04alostaleResolutionopen => fixed
2015-05-15 11:25alostaleNote Added: 0077483
2015-05-15 11:25alostaleStatusresolved => closed
2015-05-15 11:25alostaleFixed in Version => 3.0PR15Q3

Notes
(0077267)
hgbot   
2015-05-11 10:54   
Repository: erp/devel/pi
Changeset: 28a52b693c8184ce50786122fbb88121eab85f46
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon May 11 10:53:02 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/28a52b693c8184ce50786122fbb88121eab85f46 [^]

Fixes bug 29835: Prevents unlimited datasource requests when filtering the grid

The problem was that the logic to check that if a datasource request was triggered by scrolling up in a grid that did not have its initial rows loaded (see [1]) did not work well when the user filtered the grid after having scrolled down the grid till loading its second page. This caused the totalRows property of the grid to be miscalculated, and this triggered the undefinite amount of datasource requests.

The logic to check if the request was triggered by scrolling up has been changed. Now, instead of checking low-level smartclient properties like lastScrollTop, we check if there are rows loaded in the positions just after the page that was just received. Only in that case we want to prevent resetting the totalRows property of the ResultSet with the value returned by the datasource.

[1] https://code.openbravo.com/erp/devel/pi/rev/c51dce7e9fd3c47915464ab4f565a9d1cee60e3b [^]

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
---
(0077276)
AugustoMauch   
2015-05-11 13:05   
Probably the easiest way to test this issue is to place a breakpoint in this line:

dsResponse.totalRows = this.localData.length;

and then check that the execution flow only stops there when the user executes the last of these steps:
- Scroll down on a grid until at least the second page is loaded
- Refreshes the grid
- Scrolls up until the page previous to the current one is loaded
(0077314)
hudsonbot   
2015-05-11 21:53   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/a55bc3c14e8c [^]
Maturity status: Test
(0077367)
AugustoMauch   
2015-05-13 10:00   
Test added in testlink https://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-8266 [^]

An automated test will not be done as it is not easy to check using Selenium that there are ongoing unlimited requests to the Country datasource
(0077434)
alostale   
2015-05-14 11:01   
Reopening it: though now unlimited requests issue is fixed, following the steps to reproduce 2 identical requests are performed for Country DS when filtering name by "q"
(0077483)
alostale   
2015-05-15 11:25   
core reviewed

closing the issue, though reported case still launches one extra request, the biggest issue which was unlimited number of requests is already fixed.

For this second request (which is not a regression) a new issue (0029896) has been reported.