Openbravo Issue Tracking System - Retail Modules
View Issue Details
0031827Retail ModulesWeb POSpublic2016-01-05 18:212016-02-15 16:09
Orekaria 
jorge-garcia 
normalmajoralways
closedfixed 
5
 
RR16Q2 
marvintm
No
0031827: 401 errors
We are getting 401 (unauthorized) errors (most probably due to cashup)

A)
In the modules context
Execute the attached test

java.lang.AssertionError: (1) errors in the browser log:
[2016-01-05T18:17:26+0100] [SEVERE] http://127.0.0.1:8081/openbravo/org.openbravo.mobile.core.service.jsonrest/org.openbravo.retail.posterminal.ProcessCashClose [^] 0:0 Failed to load resource: the server responded with a status of 401 (Unauthorized)


B)
The issue can also be shown in the try-retail: https://ci.openbravo.com/job/try-ret-test-oracle-suite3/1137/testReport/junit/org.openbravo.test.mobile.retail.pack.selenium.tests.sharedpaymentmethods/SPMQuotationSharedPayments/test/ [^]

(1) errors in the browser log:
[2016-01-05T12:02:20+0000] [SEVERE] http://127.0.1.1/try-ret-test-oracle-suite3/org.openbravo.mobile.core.service.jsonrest/org.openbravo.mobile.core.login.ProfileUtils?authenticationClient=39363B0921BB4293B48383844325E84C&authenticationToken=J7utAlKzChUjLRrZ%2FsP0rg%3D%3D__%3B__E7ovQywJcPLl6oMHag0S5%2FBKlkLGy20pESC5gnh1bKxsQtjtRELsQJadPGXOxypfXnTJCbfJamaT8lSWFaf1v2Ov%2Ba%2B732WmbWcP%2B35pvf1RbDGAT7Fete9S%2B6p221yeo6eoQPvTsuXMcdS7t%2BRqXToEOQrwhrL8BKfYmGAxZ4z6qh35Jl8Y2r6IbejpaYPpm16TX0Xpa2ysKxRdW4maJWGTK7TVMdBcCOr62bV3zvbTwV3eRPuHb4cmv%2FJnNiNL [^] 0:0 Failed to load resource: the server responded with a status of 401 (Unauthorized)
No tags attached.
related to defect 0031928 closed Retail Test I31827_Error401WhenCashup is failling 
depends on backport 0031832RR16Q1 closed Retail 401 errors 
Issue History
2016-01-05 18:21OrekariaNew Issue
2016-01-05 18:21OrekariaAssigned To => Retail
2016-01-05 18:21OrekariaTriggers an Emergency Pack => No
2016-01-05 18:26hgbotCheckin
2016-01-05 18:26hgbotNote Added: 0083143
2016-01-05 18:28OrekariaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=10579#r10579
2016-01-05 18:28OrekariaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=10580#r10580
2016-01-05 18:29OrekariaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=10581#r10581
2016-01-05 18:30OrekariaSummary401 error when cashup => 401 errors
2016-01-05 18:30OrekariaDescription Updatedbug_revision_view_page.php?rev_id=10583#r10583
2016-01-07 10:48OrekariaStatusnew => scheduled
2016-01-13 13:00jorge-garciaAssigned ToRetail => jorge-garcia
2016-01-15 12:20hgbotCheckin
2016-01-15 12:20hgbotNote Added: 0083347
2016-01-15 12:20hgbotStatusscheduled => resolved
2016-01-15 12:20hgbotResolutionopen => fixed
2016-01-15 12:20hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/22d168dadc71475402440f344fb6ecba8f4f4677 [^]
2016-01-18 12:56jorge-garciaStatusresolved => new
2016-01-18 12:56jorge-garciaResolutionfixed => open
2016-01-18 12:59jorge-garciaNote Added: 0083369
2016-01-18 12:59jorge-garciaAssigned Tojorge-garcia => Orekaria
2016-01-18 12:59jorge-garciaStatusnew => feedback
2016-01-18 13:19jorge-garciaStatusfeedback => scheduled
2016-01-18 13:19jorge-garciaAssigned ToOrekaria => jorge-garcia
2016-01-18 13:19jorge-garciaStatusscheduled => resolved
2016-01-18 13:19jorge-garciaResolutionopen => fixed
2016-01-18 13:25jorge-garciaRelationship addedrelated to 0031928
2016-01-18 13:25jorge-garciaNote Added: 0083370
2016-02-05 13:27marvintmReview Assigned To => marvintm
2016-02-05 13:27marvintmStatusresolved => closed
2016-02-05 13:27marvintmFixed in Version => RR16Q2
2016-02-15 16:09hgbotCheckin
2016-02-15 16:09hgbotNote Added: 0084206

Notes
(0083143)
hgbot   
2016-01-05 18:26   
Repository: tools/automation/pi-mobile
Changeset: 16204c0d1d7f83f2863013ba5a553ff92235b975
Author: Rafa Alonso <ral <at> openbravo.com>
Date: Tue Jan 05 18:26:06 2016 +0100
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/16204c0d1d7f83f2863013ba5a553ff92235b975 [^]

Related to issue 31827: Add the 'I31827_Error401WhenCashup' test

---
A src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/sessions/openstoretill/I31827_Error401WhenCashup.java
---
(0083347)
hgbot   
2016-01-15 12:20   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 22d168dadc71475402440f344fb6ecba8f4f4677
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Fri Jan 15 10:47:16 2016 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/22d168dadc71475402440f344fb6ecba8f4f4677 [^]

Fixed issue 31827: 401 errors

The problem was that the session could be killed before the synchronization
process has finished.

The solution (specially in the cashup) is to wait to the end of the
synchronization process before the confimation popup (or the POS
hardware manager popup error) is shown.

---
M web/org.openbravo.retail.posterminal/js/closecash/model/cashup-model.js
---
(0083369)
jorge-garcia   
2016-01-18 12:59   
The infrastructure of the test checks the permission when the test do a login and a logout. These checks must be done when the test starts and when the test ends.
Maybe, the solution is to change this function in MobileCoreTerminalHelper:
private void verifyThatThePermissionsHaveNotChanged() {
    if (SequentialTestInfo.isTestCompatible() == false) {
      return;
    }
    TestLogger.getLogger().debug("Verifying that the 'permissions/preferences' have not changed");
    final String expectedPermissions = SequentialTestInfo.getPermissions();
    final String script = String.format(""
        + "var expectedPermissions = %s;"
        + "var currentPermissions = OB.MobileApp.model.attributes.permissions;" //
        + "if (currentPermissions === expectedPermissions) {" + " return '{}';"
        + "} else if (currentPermissions === null) {" //
        + " return JSON.stringify(expectedPermissions);" //
        + "} else if (expectedPermissions === null) {" //
        + " return JSON.stringify(currentPermissions);" //
        + "} else {" //
        + " return JSON.stringify(OB.UTIL.diffJson(currentPermissions, expectedPermissions));" //
        + "}" //
    , expectedPermissions); //
    final String currentPermissions = (String) SeleniumHelper.executeScript(script);
    assertThat(
        "The preferences (permissions) have changed. If you changed the preferences within the test, restore them to the original values",
        currentPermissions, equalTo("{}"));
  }
(0083370)
jorge-garcia   
2016-01-18 13:25   
New related issue created
(0084206)
hgbot   
2016-02-15 16:09   
Repository: retail/backports/3.0RR16Q1/org.openbravo.retail.posterminal
Changeset: 2c5ba1ce192fd9b47a1685d7c5e4155460d9cb13
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Fri Jan 15 10:47:16 2016 +0100
URL: http://code.openbravo.com/retail/backports/3.0RR16Q1/org.openbravo.retail.posterminal/rev/2c5ba1ce192fd9b47a1685d7c5e4155460d9cb13 [^]

Fixed issue 31832 backport of issue 31827: 401 errors

The problem was that the session could be killed before the synchronization
process has finished.

The solution (specially in the cashup) is to wait to the end of the
synchronization process before the confimation popup (or the POS
hardware manager popup error) is shown.

---
M web/org.openbravo.retail.posterminal/js/closecash/model/cashup-model.js
---