Openbravo Issue Tracking System - Retail Modules
View Issue Details
0027662Retail ModulesWeb POSpublic2014-09-23 15:252015-09-15 17:49
mtaal 
mtaal 
normalmajorhave not tried
closedfixed 
5
 
RR15Q4RR15Q4 
migueldejuana
No
0027662: Remote request to org.openbravo.mobile.core.login.Context to check login status causes a record to be created in ad_session tabl
The code below in the ob-terminal-model.js file checks if the user is logged in. This call results in an extra record in the ad_session table. This should not happen, no record should be created in that table for this.

 me.trigger('initializedCommonComponents');
        me.preLoadContext(function () {
          new OB.DS.Request('org.openbravo.mobile.core.login.Context').exec({
            ignoreForConnectionStatus: true
          }, function (inResponse) {
            OB.MobileApp.model.triggerOnLine();
            if (inResponse && !inResponse.exception) {
              OB.MobileApp.model.user = inResponse[0].user.username;
              if (me.isUserCacheAvailable() && window.localStorage.getItem('cacheAvailableForUser:' + OB.MobileApp.model.user)) {
                me.loginUsingCache();
              } else {
                OB.MobileApp.model.set('orgUserId', inResponse[0].user.id);
                OB.UTIL.showLoading(true);
                me.set('context', inResponse[0]);
                me.renderTerminalMain();
              }
            } else {
- check count in ad_session table
- open webpos page, login page is shown
- check that the count in the session table has increased by one
No tags attached.
png Selection_007.png (341,142) 2015-09-09 10:22
https://issues.openbravo.com/file_download.php?file_id=8438&type=bug
Issue History
2014-09-23 15:25mtaalNew Issue
2014-09-23 15:25mtaalAssigned To => mtaal
2014-09-23 15:25mtaalTriggers an Emergency Pack => No
2014-09-30 17:42mtaalTarget Version => RR15Q1
2014-12-01 16:12shuehnerIssue Monitored: shuehner
2014-12-08 11:51mtaalTarget VersionRR15Q1 => RR15Q2
2015-03-30 20:14marvintmTarget VersionRR15Q2 => RR15Q3
2015-06-15 18:16marvintmTarget VersionRR15Q3 => RR15Q4
2015-09-09 10:22mtaalFile Added: Selection_007.png
2015-09-09 10:23mtaalNote Added: 0080271
2015-09-09 10:39mtaalNote Added: 0080272
2015-09-10 09:09hgbotCheckin
2015-09-10 09:09hgbotNote Added: 0080305
2015-09-10 09:09hgbotStatusnew => resolved
2015-09-10 09:09hgbotResolutionopen => fixed
2015-09-10 09:09hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/a7fad012414bc6b03a8b8800f27582d824d1d092 [^]
2015-09-15 14:00mtaalReview Assigned To => migueldejuana
2015-09-15 17:49migueldejuanaNote Added: 0080422
2015-09-15 17:49migueldejuanaStatusresolved => closed
2015-09-15 17:49migueldejuanaFixed in Version => RR15Q4

Notes
(0080271)
mtaal   
2015-09-09 10:23   
Happens in pi-q4 still, could be related to the message shown in the attachment
(0080272)
mtaal   
2015-09-09 10:39   
Tested again in pi-q4, when opening the webpos page several requests are done. I tested individual requests by opening an anonymous chrome for each one by one. The list is below. Only this request resulted in an extra record in ad_session:
http://localhost:8080/openbravo/org.openbravo.mobile.core.context?ignoreForConnectionStatus=true [^]

The other requests didn't:
http://localhost:8080/openbravo/org.openbravo.retail.posterminal.service.loginutils?terminalName=VBS-1&command=initActions&0.8726465555373579 [^]

http://localhost:8080/openbravo/org.openbravo.mobile.core/OBMOBC_Main/ClientModel?entity=FinancialMgmtTaxRate&modelName=TaxRate&source=org.openbravo.retail.posterminal.master.TaxRate [^]

http://localhost:8080/openbravo/org.openbravo.retail.posterminal.service.loginutils?terminalName=VBS-1&command=preRenderActions [^]

http://localhost:8080/openbravo/org.openbravo.retail.posterminal.service.loginutils?terminalName=VBS-1&command=companyLogo&appName=WebPOS&0.9206963295582682 [^]

http://localhost:8080/openbravo/org.openbravo.retail.posterminal.service.loginutils?terminalName=VBS-1&command=userImages&appName=WebPOS&0.1618948788382113 [^]
(0080305)
hgbot   
2015-09-10 09:09   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: a7fad012414bc6b03a8b8800f27582d824d1d092
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Wed Sep 09 11:59:35 2015 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/a7fad012414bc6b03a8b8800f27582d824d1d092 [^]

Fixes issue 27662: Remote request to org.openbravo.mobile.core.login.Context to check login status causes a record to be created in ad_session tabl
Check for isAuthenticated in a more explicit way without calling authentication manager

---
M src/org/openbravo/mobile/core/login/Context.java
---
(0080422)
migueldejuana   
2015-09-15 17:49   
Tested and reviewed in 5fa909d5e1af