Openbravo Issue Tracking System - Retail Modules
View Issue Details
0038361Retail ModulesWeb POSpublic2018-04-13 10:152018-12-11 20:22
egoitz 
marvintm 
normalmajoralways
closedfixed 
5
 
RR19Q1 
migueldejuana
OBPS
No
0038361: The terminal does not go to offline mode if the database is colapsed but the tomcat works
If for example, the database get out of connections, the webpos does not go offline.
-Access to a terminal
-Stop postgresql.
-Refresh the application.
*It tryies to login but then you are continuosly requested to login again.
OFFLINE does not work
No tags attached.
depends on backport 0039445RR18Q4 closed marvintm The terminal does not go to offline mode if the database is colapsed but the tomcat works 
depends on backport 0039446RR18Q3.2 closed marvintm The terminal does not go to offline mode if the database is colapsed but the tomcat works 
depends on backport 0039451RR18Q2.4 closed marvintm The terminal does not go to offline mode if the database is colapsed but the tomcat works 
Issue History
2018-04-13 10:15egoitzNew Issue
2018-04-13 10:15egoitzAssigned To => Retail
2018-04-13 10:15egoitzOBNetwork customer => Yes
2018-04-13 10:15egoitzTriggers an Emergency Pack => No
2018-05-03 09:19egoitzSummaryThe terminal does not go to offline mode if the database is colapsed but the application works => The terminal does not go to offline mode if the database is colapsed but the tomcat works
2018-05-03 09:19egoitzSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=17074#r17074
2018-06-26 16:30egoitzResolution time => 1531778400
2018-06-26 16:30egoitzTypedesign defect => defect
2018-07-11 15:08rqueraltaAssigned ToRetail => rqueralta
2018-07-13 13:36migueldejuanaAssigned Torqueralta => migueldejuana
2018-07-16 17:52jorge-garciaAssigned Tomigueldejuana => jorge-garcia
2018-07-24 13:44martinsdanIssue Monitored: martinsdan
2018-08-23 12:53marvintmResolution time1531778400 => 1538344800
2018-08-23 12:53marvintmCategoryOffline Mode => Web POS
2018-08-23 12:53marvintmTypedefect => design defect
2018-08-23 12:53marvintmStatusnew => scheduled
2018-08-23 12:53marvintmAssigned Tojorge-garcia => marvintm
2018-09-05 12:17rafarodaIssue Monitored: rafaroda
2018-10-15 10:36marvintmStatusscheduled => acknowledged
2018-10-15 10:36marvintmStatusacknowledged => scheduled
2018-10-15 10:42hgbotCheckin
2018-10-15 10:42hgbotNote Added: 0107286
2018-10-15 10:42hgbotStatusscheduled => resolved
2018-10-15 10:42hgbotResolutionopen => fixed
2018-10-15 10:42hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/31f161352319157b70bc6c6d11ad1719cc5df556 [^]
2018-10-15 10:42hgbotCheckin
2018-10-15 10:42hgbotNote Added: 0107287
2018-10-15 10:43hgbotCheckin
2018-10-15 10:43hgbotNote Added: 0107288
2018-10-15 10:43hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/31f161352319157b70bc6c6d11ad1719cc5df556 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/d8a54fc7c2683e641af3aaba83f9db35fdbc5ab8 [^]
2018-10-15 10:43hgbotCheckin
2018-10-15 10:43hgbotNote Added: 0107289
2018-10-15 10:43hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/d8a54fc7c2683e641af3aaba83f9db35fdbc5ab8 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/c73d499af2679e0df61e2f7d08fa62340efba4dd [^]
2018-10-15 10:43hgbotCheckin
2018-10-15 10:43hgbotNote Added: 0107290
2018-10-15 10:43hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/c73d499af2679e0df61e2f7d08fa62340efba4dd [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/54d25661ddc24983b27c2d6916332b659357cc3d [^]
2018-10-15 10:43hgbotCheckin
2018-10-15 10:43hgbotNote Added: 0107291
2018-10-15 10:43hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/54d25661ddc24983b27c2d6916332b659357cc3d [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/5b04e6405abddbe3437e107ceb102df41930a4e8 [^]
2018-10-15 10:43hgbotCheckin
2018-10-15 10:43hgbotNote Added: 0107292
2018-10-15 10:43hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/5b04e6405abddbe3437e107ceb102df41930a4e8 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/e78063c7fddfe836b3b98e5380713594f9e65045 [^]
2018-10-15 10:43hgbotCheckin
2018-10-15 10:43hgbotNote Added: 0107293
2018-10-15 10:43hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/e78063c7fddfe836b3b98e5380713594f9e65045 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/b0f80aa0446b1426f43e8843d9a3f037b5b71f74 [^]
2018-10-15 10:43hgbotCheckin
2018-10-15 10:43hgbotNote Added: 0107294
2018-10-15 10:43hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/b0f80aa0446b1426f43e8843d9a3f037b5b71f74 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/283ba9e128a4e165f06c38f924d1815cdc52f083 [^]
2018-10-15 10:43hgbotCheckin
2018-10-15 10:43hgbotNote Added: 0107295
2018-10-15 10:43hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/283ba9e128a4e165f06c38f924d1815cdc52f083 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/a16a113b5f65ce8cc671f1bead1a54a8b569bc52 [^]
2018-10-15 10:43hgbotCheckin
2018-10-15 10:43hgbotNote Added: 0107296
2018-10-15 15:22marvintmStatusresolved => new
2018-10-15 15:22marvintmResolutionfixed => open
2018-10-15 15:22marvintmStatusnew => scheduled
2018-10-15 15:22marvintmStatusscheduled => resolved
2018-10-15 15:22marvintmFixed in Version => RR19Q1
2018-10-15 15:22marvintmResolutionopen => fixed
2018-10-16 14:15hgbotCheckin
2018-10-16 14:15hgbotNote Added: 0107336
2018-10-16 16:15migueldejuanaReview Assigned To => migueldejuana
2018-10-16 16:15migueldejuanaNote Added: 0107340
2018-10-16 16:15migueldejuanaStatusresolved => closed
2018-12-11 20:22hudsonbotCheckin
2018-12-11 20:22hudsonbotNote Added: 0108426
2018-12-11 20:22hudsonbotCheckin
2018-12-11 20:22hudsonbotNote Added: 0108427

Notes
(0107286)
hgbot   
2018-10-15 10:42   
Repository: erp/devel/pi
Changeset: 31f161352319157b70bc6c6d11ad1719cc5df556
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 11 18:18:19 2018 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/31f161352319157b70bc6c6d11ad1719cc5df556 [^]

Fixed issue 38361. The terminal does not go to offline mode if the database is colapsed but the tomcat works
When there is an exception in the critical part of the HttpSecureAppServlet which tries to detect if the client is authenticated, we should not necessarily force a logout and reply with '401- Not authenticated' response. Instead, the appropriate action is to just return a '500-Internal Server Error' response. Logging out in this case may kill a valid request when the server is temporarily overloaded, and makes no sense, and the 401 response may confuse the client, thinking that it needs to do login again when in reality, the problem is just that the server is either overloaded, or affected by some serious problem which prevents even basic authentication checking to work.

---
M src/org/openbravo/base/secureApp/HttpSecureAppServlet.java
---
(0107287)
hgbot   
2018-10-15 10:42   
Repository: erp/devel/pi
Changeset: 618fcb380761b3580d202c292f1d5b1ede437123
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Mon Oct 15 10:41:39 2018 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/618fcb380761b3580d202c292f1d5b1ede437123 [^]

Related to issue 38361. Improved comment and log.

---
M src/org/openbravo/base/secureApp/HttpSecureAppServlet.java
---
(0107288)
hgbot   
2018-10-15 10:43   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: d8a54fc7c2683e641af3aaba83f9db35fdbc5ab8
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Sun Oct 14 10:58:08 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/d8a54fc7c2683e641af3aaba83f9db35fdbc5ab8 [^]

Fixed issue 38361. The terminal does not go to offline mode if the database is colapsed but the tomcat works
Two changes have been made:
- In the main Terminal request, if the response is not a known message, then most probably it is a critical error which happened in the server when trying to compute the terminal. In this case, it is better to try to force an offline login than block the process, as this may otherwise make it impossible to do an offline login in the system when the server is affected by some serious problem.
- In the loginUtils request, if the request fails with an unexpected error, we will try to continue with the main flow to allow an offline login to be completed.

---
M web/org.openbravo.retail.posterminal/js/login/model/login-model.js
---
(0107289)
hgbot   
2018-10-15 10:43   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: c73d499af2679e0df61e2f7d08fa62340efba4dd
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 11 18:25:04 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/c73d499af2679e0df61e2f7d08fa62340efba4dd [^]

Fixed issue 38361. The terminal does not go to offline mode if the database is colapsed but the tomcat works
Added some basic check with a database query. Modified the response to ensure that it follows a correct format.

---
M src/org/openbravo/mobile/core/login/CheckServerAvailability.java
---
(0107290)
hgbot   
2018-10-15 10:43   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 54d25661ddc24983b27c2d6916332b659357cc3d
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 11 18:27:03 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/54d25661ddc24983b27c2d6916332b659357cc3d [^]

Fixed issue 38361. The terminal does not go to offline mode if the database is colapsed but the tomcat works
If server ran out of connections, we will generate an '500-Internal Server Error'. Otherwise, if it's just a normal Exception, we assume that it is a plain defect in functional code which should not be considered cause of a general server problem, and will return a standard error with a 200 response.

---
M src/org/openbravo/mobile/core/login/MobileCoreLoginUtilsServlet.java
---
(0107291)
hgbot   
2018-10-15 10:43   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 5b04e6405abddbe3437e107ceb102df41930a4e8
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 11 18:28:07 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/5b04e6405abddbe3437e107ceb102df41930a4e8 [^]

Fixed issue 38361. The terminal does not go to offline mode if the database is colapsed but the tomcat works
Do not catch Throwables, we just let them leak to super classes, in which they will be handled correctly (will still return '500 Internal Server error' in this case)

---
M src/org/openbravo/mobile/core/process/MobileService.java
---
(0107292)
hgbot   
2018-10-15 10:43   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: e78063c7fddfe836b3b98e5380713594f9e65045
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 11 18:28:46 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/e78063c7fddfe836b3b98e5380713594f9e65045 [^]

Fixed issue 38361. The terminal does not go to offline mode if the database is colapsed but the tomcat works
Do not catch Throwables, we just let them leak to super classes, in which they will be handled correctly (will still return '500 Internal Server error' in this case).

---
M src/org/openbravo/mobile/core/process/WebServiceAbstractServlet.java
---
(0107293)
hgbot   
2018-10-15 10:43   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: b0f80aa0446b1426f43e8843d9a3f037b5b71f74
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 11 18:30:22 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/b0f80aa0446b1426f43e8843d9a3f037b5b71f74 [^]

Fixed issue 38361. The terminal does not go to offline mode if the database is colapsed but the tomcat works
> Avoid setting wrong (unauthorized) state, in case HttpSecureAppServlet was affected by an exception in a critical part, and returned a 500 state

---
M src/org/openbravo/mobile/core/process/WebServiceAuthenticatedServlet.java
---
(0107294)
hgbot   
2018-10-15 10:43   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 283ba9e128a4e165f06c38f924d1815cdc52f083
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 11 18:31:33 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/283ba9e128a4e165f06c38f924d1815cdc52f083 [^]

Fixed issue 38361. The terminal does not go to offline mode if the database is colapsed but the tomcat works
Ensure transitionToOnline counter correctly resets to the next step, in case of CheckServerAvailability error.

---
M web/org.openbravo.mobile.core/source/data/ob-requestrouter.js
---
(0107295)
hgbot   
2018-10-15 10:43   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: a16a113b5f65ce8cc671f1bead1a54a8b569bc52
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 11 18:32:22 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/a16a113b5f65ce8cc671f1bead1a54a8b569bc52 [^]

Fixed issue 38361. The terminal does not go to offline mode if the database is colapsed but the tomcat works
When doing offline login ensure that when connectedToERP variable changes due to the load of the Terminal object from cache, this doesn't affect the rest of the login process.

---
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---
(0107296)
hgbot   
2018-10-15 10:43   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: e94772afb866d11a831fe68e73d6ef5cdb03be54
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Sat Oct 13 19:02:46 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/e94772afb866d11a831fe68e73d6ef5cdb03be54 [^]

Related to issue 38361. Applied formatter.

---
M web/org.openbravo.mobile.core/source/data/ob-requestrouter.js
---
(0107336)
hgbot   
2018-10-16 14:15   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 7bfcd71dd516c7dc73864eb9a6af298533c996f5
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Tue Oct 16 14:15:30 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/7bfcd71dd516c7dc73864eb9a6af298533c996f5 [^]

Related to issue 38361. Language will not be reset if response is invalid.

---
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---
(0107340)
migueldejuana   
2018-10-16 16:15   
Tested and reviewed
(0108426)
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
(0108427)
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