Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0039531Openbravo ERPA. Platformpublic2018-10-24 13:412018-12-11 20:22
guillermogil 
caristu 
normalmajorrandom
closedfixed 
5
 
3.0PR19Q1 
alostale
Core
No
0039531: Generated JS can be different from SS to CS due to a missing orderBy in Component Provider structure
Generated JS can be different from SS to CS due to a missing orderBy in Component Provider structure.
It may happen when modules have same dependencies and the query does not order it.

In the case different JS files are generated a popup saying "your application has changed" will rise and will require to logout. If you login again same popup will rise.
1) Apply the patch: sortAscending.diff. This patch retrieves the modules to calculate their dependencies in ascending order by ID. Rebuild the application.
2) Login in Openbravo.
3) Check the name of the JS file containing the static resources in web/js/gen
4) Revert the patch applied in 1)
5) Apply the patch: sortDescending.diff. This patch retrieves the modules to calculate their dependencies in descending order by ID. Rebuild the application.
6) Login in Openbravo.
7) Check the name of the JS file and notice that is different from the name in step 3) although the static resources have not been modified.
In KernelUtils.getModulesOrderedByDependency(), retrieve the modules from DB using a fixed sorting criteria.
No tags attached.
diff sortAscending.diff (1,071) 2018-10-24 17:34
https://issues.openbravo.com/file_download.php?file_id=12315&type=bug
diff sortDescending.diff (1,072) 2018-10-24 17:34
https://issues.openbravo.com/file_download.php?file_id=12316&type=bug
Issue History
2018-10-24 13:41guillermogilNew Issue
2018-10-24 13:41guillermogilAssigned To => platform
2018-10-24 13:41guillermogilModules => Core
2018-10-24 13:41guillermogilTriggers an Emergency Pack => No
2018-10-24 13:43guillermogilFile Added: fixDifferentVersionMultiServer.diff
2018-10-24 16:21guillermogilDescription Updatedbug_revision_view_page.php?rev_id=17838#r17838
2018-10-24 17:32caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=17840#r17840
2018-10-24 17:33caristuAssigned Toplatform => caristu
2018-10-24 17:34caristuFile Added: sortAscending.diff
2018-10-24 17:34caristuFile Added: sortDescending.diff
2018-10-24 17:34caristuFile Deleted: fixDifferentVersionMultiServer.diff
2018-10-24 17:35caristuProposed Solution updated
2018-10-24 17:50hgbotCheckin
2018-10-24 17:50hgbotNote Added: 0107554
2018-10-24 17:50hgbotStatusnew => resolved
2018-10-24 17:50hgbotResolutionopen => fixed
2018-10-24 17:50hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/69d55ed0f71cde21030a141595a68e129cf25898 [^]
2018-10-24 17:51caristuReview Assigned To => alostale
2018-10-24 17:56hgbotCheckin
2018-10-24 17:56hgbotNote Added: 0107555
2018-10-26 08:48alostaleNote Added: 0107608
2018-10-26 08:48alostaleStatusresolved => closed
2018-10-26 08:48alostaleFixed in Version => 3.0PR19Q1
2018-12-11 20:22hudsonbotCheckin
2018-12-11 20:22hudsonbotNote Added: 0108441
2018-12-11 20:22hudsonbotCheckin
2018-12-11 20:22hudsonbotNote Added: 0108442

Notes
(0107554)
hgbot   
2018-10-24 17:50   
Repository: erp/devel/pi
Changeset: 69d55ed0f71cde21030a141595a68e129cf25898
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Oct 24 17:50:25 2018 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/69d55ed0f71cde21030a141595a68e129cf25898 [^]

fixes issue 39531: getModulesOrderedByDependency() result is not deterministic

  The JS file containing the static resources is generated by processing them in the order defined by the position of their corresponding modules in the list returned by the KernelUtils.getModulesOrderedByDependency() method. The module sorting is calculated in Java, but it also depends on the order used when retrieving the module information from database.

  As there was not a fixed order to retrieve the modules, the result of the method was not deterministic, which could lead to generate a different JS file with the static resources although they were not being modified.

  To fix the problem we are now retrieving the modules from database with a fixed sorting in the getModulesOrderedByDependency() method.

---
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelUtils.java
---
(0107555)
hgbot   
2018-10-24 17:56   
Repository: erp/devel/pi
Changeset: 4a141858f055a88573c3dc352c08d97173ac08a0
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Oct 24 17:56:17 2018 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/4a141858f055a88573c3dc352c08d97173ac08a0 [^]

related to issue 39531: add log info

---
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelUtils.java
---
(0107608)
alostale   
2018-10-26 08:48   
reviewed
(0108441)
hudsonbot   
2018-12-11 20:22   
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/470e3cd384c5 [^]
Maturity status: Test
(0108442)
hudsonbot   
2018-12-11 20:22   
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/470e3cd384c5 [^]
Maturity status: Test