Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0042595
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2019-12-18 13:252020-01-17 08:15
ReportermarvintmView Statuspublic 
Assigned Tocberner 
PrioritynormalResolutionfixedFixed in Version3.0PR20Q2
StatusclosedFix in branchFixed in SCM revision1287a292a138
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tocaristu
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0042595: StyleSheet components and StaticResource components do not follow the same criteria for development mode

DescriptionCurrently:

- Both StyleSheetResourceComponents and StaticResourceComponents are cached if the system is not in development.
- Both components are added to the manifest for ServiceWorkers functionality for mobile applications
- StyleSheetResource uses the cache information to generate the eTag in case the component is cached
- Manifest component uses the isindevelopment implementation of the StaticResourceComponent to know if it should be empty (in development), or should contain all resources (not in development).

The main issue is that the implementation of the "isInDevelopment" method in StyleSheetResourceComponent and the StaticResourceComponent are not the same, and can return different results depending on the configuration of the system, and this can lead to very confusing behaviour.

The problem is not very serious, as it doesn't affect production instances and only affects developers, but it can be quite annoying if you are developing CSS changes and the WebPOS is not set as in development, and other modules are set as in development.
Steps To ReproduceThe confusing behaviour we got was the following:
- We had an instance with a module which depended on the WebPOS set as in development. The rest of the modules were set as not in development.
- The StaticResourceComponent (correctly) considered that the instance was in development. The WebPOS was shown in development, the manifest was empty, and if the developer did a change in a js file, and refreshed the page, the JS file would be regenerated.
- However, the StyleSheetResourceComponent request, although it was triggered and reached the backend, returned 304 (not modified), because the eTag did not change.
- The reason for this is that the CSS was cached, and the eTag always returned the same checksum.

This was quite confusing because even though the system was in development, in order to test CSS changes you had to restart Tomcat everytime, which was quite annoying.
Proposed SolutionI think we should just follow the same criteria to decide if the system is in development in all parts of the application. In particular, I think the criteria currently followed by the StyleSheetCriteria is wrong, and the same criteria currently used by the StaticResourceComponent should be followed.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
causes defect 0042792 closedcberner API Change: Remove custom isIndevelopment method from some BaseTemplateComponent classes 

-  Notes
(0116576)
cberner (developer)
2019-12-30 16:35

Being tracked in this merge request: https://gitlab.com/openbravo/product/openbravo/merge_requests/29 [^]
(0116852)
hgbot (developer)
2020-01-14 13:23

Repository: erp/devel/pi
Changeset: 1287a292a1382d75c533cc758fcf3b473cfecd25
Author: Cristian Berner <cristian.berner <at> openbravo.com>
Date: Wed Jan 08 12:48:53 2020 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/1287a292a1382d75c533cc758fcf3b473cfecd25 [^]

Fixes BUG-42595: Don't cache StyleSheets if any module in development

Previously StyleSheets were cached if working on a module and there weren't any other module with CSS set to inDevelopment

Behaviour for checking if instance is in development is now the same for both StyleSheetResourceComponent and StaticResourceComponent. It follows BaseComponent isInDevelopment logic, if a module is in development, all the instance is in development.

---
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/StaticResourceComponent.java
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/StyleSheetResourceComponent.java
---
(0116853)
hgbot (developer)
2020-01-14 13:23

Repository: erp/devel/pi
Changeset: 82de1963f8ba67943052301c118704352a9cae3f
Author: Cristian Berner <cristian.berner <at> openbravo.com>
Date: Wed Jan 08 13:52:10 2020 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/82de1963f8ba67943052301c118704352a9cae3f [^]

Related to ISSUE-42595: Apply same isInDevelopment logic for caching

Caching of resources should be the same across all BaseComponents, with some small exceptions. BaseComponent isInDevelopment method should be used instead of new private methods.

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/attachment/AttachmentWindowComponent.java
M modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ParameterWindowComponent.java
M modules/org.openbravo.client.application/src/org/openbravo/client/application/window/StandardWindowComponent.java
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/BaseComponent.java
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/StaticResourceComponent.java
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/StyleSheetResourceComponent.java
---
(0116855)
hgbot (developer)
2020-01-14 13:30

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: bb55eaef132d29427a345d872ca8626dd335dfa8
Author: Cristian Berner <cristian.berner <at> openbravo.com>
Date: Thu Jan 09 16:46:38 2020 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/bb55eaef132d29427a345d872ca8626dd335dfa8 [^]

Related to ISSUE-42595: Use same isInDevelopment logic for caching

---
M src/org/openbravo/mobile/core/LibraryResource.java
M src/org/openbravo/mobile/core/MobileCoreApplicationCacheComponent.java
---
(0116966)
caristu (developer)
2020-01-17 08:15

Reviewed

- Issue History
Date Modified Username Field Change
2019-12-18 13:25 marvintm New Issue
2019-12-18 13:25 marvintm Assigned To => platform
2019-12-18 13:25 marvintm Modules => Core
2019-12-18 13:25 marvintm Triggers an Emergency Pack => No
2019-12-18 13:32 marvintm Steps to Reproduce Updated View Revisions
2019-12-18 13:32 marvintm Proposed Solution updated
2019-12-18 13:33 marvintm Description Updated View Revisions
2019-12-18 13:34 marvintm Steps to Reproduce Updated View Revisions
2019-12-30 16:27 cberner Assigned To platform => cberner
2019-12-30 16:27 cberner Status new => acknowledged
2019-12-30 16:27 cberner Status acknowledged => scheduled
2019-12-30 16:29 cberner Review Assigned To => caristu
2019-12-30 16:35 cberner Note Added: 0116576
2020-01-10 08:51 cberner Relationship added causes 0042792
2020-01-14 13:23 hgbot Checkin
2020-01-14 13:23 hgbot Note Added: 0116852
2020-01-14 13:23 hgbot Status scheduled => resolved
2020-01-14 13:23 hgbot Resolution open => fixed
2020-01-14 13:23 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/1287a292a1382d75c533cc758fcf3b473cfecd25 [^]
2020-01-14 13:23 hgbot Checkin
2020-01-14 13:23 hgbot Note Added: 0116853
2020-01-14 13:30 hgbot Checkin
2020-01-14 13:30 hgbot Note Added: 0116855
2020-01-17 08:15 caristu Note Added: 0116966
2020-01-17 08:15 caristu Status resolved => closed
2020-01-17 08:15 caristu Fixed in Version => 3.0PR20Q2


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker