Openbravo Issue Tracking System - Retail Modules
View Issue Details
0027555Retail ModulesWeb POSpublic2014-09-08 16:172014-09-26 09:00
mtaal 
mtaal 
normalmajorhave not tried
closedfixed 
5
 
RR14Q4RR14Q4 
alostale
No
0027555: With slow system generated js file is not there when already requested, wrong filename
See attached image. After analyzing it seems that the appcache already returns the name of the generated file before the file is actually present. This results in a 404 and all kinds of other issues when loading the page.

The code can be restructured so that returning the appcache is only done when the file has actually been generated.

put a break point in the generate part
visit webpos page
No tags attached.
blocks feature request 0027329 new Retail Stabilization: Overhaul the loading process (since the url is entered until the webpos has loaded) 
causes defect 0027936 closed Orekaria The javascript generated file is missing the application name 
png Selection_011.png (42,342) 2014-09-08 16:17
https://issues.openbravo.com/file_download.php?file_id=7221&type=bug
png

diff Q3manifestRace.diff (6,793) 2014-09-12 16:28
https://issues.openbravo.com/file_download.php?file_id=7239&type=bug
Issue History
2014-09-08 16:17mtaalNew Issue
2014-09-08 16:17mtaalAssigned To => mtaal
2014-09-08 16:17mtaalFile Added: Selection_011.png
2014-09-08 16:17mtaalTriggers an Emergency Pack => No
2014-09-10 14:42shuehnerIssue Monitored: shuehner
2014-09-11 03:38hgbotCheckin
2014-09-11 03:38hgbotNote Added: 0070079
2014-09-11 03:38hgbotStatusnew => resolved
2014-09-11 03:38hgbotResolutionopen => fixed
2014-09-11 03:38hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/615336731b8e601120f40fd08cbc55d135591490 [^]
2014-09-11 03:49OrekariaRelationship addedblocks 0027414
2014-09-11 04:57hgbotCheckin
2014-09-11 04:57hgbotNote Added: 0070081
2014-09-11 10:41mtaalNote Added: 0070082
2014-09-11 11:01OrekariaIssue Monitored: Orekaria
2014-09-11 17:00OrekariaStatusresolved => new
2014-09-11 17:00OrekariaResolutionfixed => open
2014-09-11 17:00OrekariaNote Deleted: 0070081
2014-09-11 17:00OrekariaNote Deleted: 0070079
2014-09-11 17:01hgbotCheckin
2014-09-11 17:01hgbotNote Added: 0070086
2014-09-11 17:01hgbotStatusnew => resolved
2014-09-11 17:01hgbotResolutionopen => fixed
2014-09-11 17:01hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/615336731b8e601120f40fd08cbc55d135591490 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/8d602e983f7f8ff604f402365c38d4fe4e58e1b3 [^]
2014-09-11 17:03OrekariaStatusresolved => new
2014-09-11 17:03OrekariaResolutionfixed => open
2014-09-11 17:04OrekariaFile Added: patch.diff
2014-09-11 17:04OrekariaStatusnew => scheduled
2014-09-11 17:04Orekariafix_in_branch => pi
2014-09-11 17:04OrekariaReview Assigned To => alostale
2014-09-11 17:04Orekariafix_in_branchpi =>
2014-09-12 01:10hgbotCheckin
2014-09-12 01:10hgbotNote Added: 0070091
2014-09-12 16:27OrekariaFile Deleted: patch.diff
2014-09-12 16:28OrekariaFile Added: Q3manifestRace.diff
2014-09-12 17:41OrekariaRelationship addedblocks 0027329
2014-09-22 16:20mtaalTarget VersionRR14Q4 =>
2014-09-22 17:05mtaalTarget Version => RR14Q4
2014-09-24 09:54OrekariaStatusscheduled => resolved
2014-09-24 09:54OrekariaFixed in Version => RR14Q4
2014-09-24 09:54OrekariaResolutionopen => fixed
2014-09-24 23:39hgbotCheckin
2014-09-24 23:39hgbotNote Added: 0070336
2014-09-24 23:39hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/8d602e983f7f8ff604f402365c38d4fe4e58e1b3 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/97ff2c91e221b23b6288206a97daa931e4229bf1 [^]
2014-09-26 09:00alostaleNote Added: 0070423
2014-09-26 09:00alostaleStatusresolved => closed
2014-11-07 10:52OrekariaRelationship addedcauses 0027936

Notes
(0070082)
mtaal   
2014-09-11 10:41   
Hi Rafa,
Some comments:
- the code which is in the getGenFileName in the MobileCoreApplicationCacheComponent should be moved completely to the MobileStaticResourceComponent component. So there is one place where this is done. (note that the 2 codes are even different now, so is a bug :-)

- no need to use a static, better to use injection here

- make the code which actually generates the js file synchronized so it is called once

- not sure how often the generate or isDevelopment is called, if a lot the isDevelopment should be cached

gr. Martin
(0070086)
hgbot   
2014-09-11 17:01   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 8d602e983f7f8ff604f402365c38d4fe4e58e1b3
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Thu Sep 11 17:01:03 2014 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/8d602e983f7f8ff604f402365c38d4fe4e58e1b3 [^]

Fixes issue 27555: Mobile core will correctly generate the javascript when its first accessed

---
M src/org/openbravo/mobile/core/MobileCoreApplicationCacheComponent.java
M src/org/openbravo/mobile/core/MobileStaticResourceComponent.java
---
(0070091)
hgbot   
2014-09-12 01:10   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: c9c6593cbfb87b812b3a35c367ea616c7ebe95da
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Fri Sep 12 01:09:33 2014 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/c9c6593cbfb87b812b3a35c367ea616c7ebe95da [^]

Related to issue 27555: the logic for the generation of the javascript file has seen the following changes:
- the decision of if a new file must be generated is now centralized in the synchronized 'generateStaticResources' method
- fixed the inDevelopment mode
- fixed the check if the file exists
- better comments

---
M src/org/openbravo/mobile/core/MobileStaticResourceComponent.java
---
(0070336)
hgbot   
2014-09-24 23:39   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 97ff2c91e221b23b6288206a97daa931e4229bf1
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Wed Sep 24 23:38:48 2014 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/97ff2c91e221b23b6288206a97daa931e4229bf1 [^]

Fixes issue 27555: The decision to create a new javascript file and to keep them have been modified:

A new file is created when:
- each time tomcat is started
- a module changes its version
- a module is 'in development'
- if the file does not exists

Only 1 mobile.core generated file will be present
- all mobile.core generated files will be removed, as only the last one is valid and no terminal should use any other

Notes:
- the file will allways have the mobile.core suffix ('_OBMOBCR' as of now)
- to force the creation of a new one:
  1. delete the file from the /WebContent/web/js/gen directory
  2. restart tomcat
  3. only while developing and not to need a module 'in development'; add 'isModuleVersionChange = true;' just before the 'if (generatedJavascriptFilename == null //' line

---
M src/org/openbravo/mobile/core/MobileStaticResourceComponent.java
---
(0070423)
alostale   
2014-09-26 09:00   
Code reviewed

tested:

Simulating a slow static resources generation by adding sleeps appcache is not served till the actual js file is already created