Anonymous | Login
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] StoreServermajoralways2018-08-23 12:592018-12-10 16:19
ReporteraaroncaleroView Statuspublic 
Assigned Tomtaal 
PriorityhighResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision3935f5cec633
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned ToAugustoMauch
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo

0039179: Changing the Role in a multiserver environment only changes the context in the Store

DescriptionIn a multiserver environment, when a login is done in webpos, sessions are created for both the store and the central servers (so it is possible to enter in both backends without relogging).
If a Role change is performed in WebPOS, this change is only reflected in the session of the Store Server.
Steps To ReproduceIn a multiserver environment:
Login in web pos with a user with several roles.
On the same browser session, open both the store server and the central server backends.
Verify that the user/profile information is the same in both backends.
In WebPOS, go to the menu > User > Profile, change the role and click on Apply.
After the pos has finished reloading, verify the profile information again in both backends.
> The backend of the Store Server will show the changed role
> The backend of the Central Server will show the original role, which is wrong.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to feature request 0039625pi closedmtaal The WebPOS broadcast service calls success always only on first server irrespective of its state 

-  Notes
mtaal (manager)
2018-09-11 20:07

Add code like below [1] in utils and [2] when reloading the page or after logging in.

OB.UTIL.callCentralServer = function (serviceUrl, data, success, error) {
  var servers = OB.RR.RequestRouter.servers,
      method = 'POST',
      server = _.filter(servers.models, function (srv) {
      return srv.get('mainServer');
  OB.UTIL.callServer(server.get('name'), serviceUrl, data, success, error);

OB.UTIL.loginOnCentralServer = function (success, error) {
  OB.UTIL.callCentralServer('', null, success, error);

hgbot (developer)
2018-10-01 05:50
edited on: 2018-10-01 06:55

Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: 3935f5cec633a3df0725af34d643afcbdc289e62
Author: Martin Taal <martin.taal <at>>
Date: Mon Oct 01 05:50:05 2018 +0200
URL: [^]

Fixes issue 39179: Changing the Role in a multiserver environment only changes the context in the Store
Make the change role service broadcast so that all servers change the role

No code change was needed.

A src-db/database/sourcedata/OBMOBC_SERVICES.xml

AugustoMauch (developer)
2018-10-16 16:12

Code reviewed and verified
guillermogil (manager)
2018-10-24 09:27

Reopened due to failure in Single Server if there is a Mobile Server defined in Offline status.
It tries to do 2 calls, one fails and no callback gets executed.
mtaal (manager)
2018-11-14 11:42
edited on: 2018-11-14 11:44

Other reflection: there is also server to server communication. In this we use a cached session cookie [1] from the cs. So this is the session cookie of the session in the cs, this session cookie is cached in the ss session so it can be re-used when doing a ss-->cs request.

This cached session cookie is also (correctly) removed from the ss session at role change. So that a next call to the cs will do a relogin using the new role.

[1] [^]

mtaal (manager)
2018-12-01 19:54

I retested this and works:
- install multi-server
- run, login webpos
- check the backoffice and see the role (VallblancaUser for example), check in the same browser both central and store
- then in webpos change role (to VallblancaManual for example), check backoffice for both store and central

The question how the system operates when one of the servers is down is handled in the related issue. It is a broader question on how to handle success/failure in broadcast messages.
AugustoMauch (developer)
2018-12-10 16:19

Code reviewed and verified

- Issue History
Date Modified Username Field Change
2018-08-23 12:59 aaroncalero New Issue
2018-08-23 12:59 aaroncalero Assigned To => StoreServer
2018-08-23 12:59 aaroncalero Triggers an Emergency Pack => No
2018-09-11 12:10 mtaal Assigned To StoreServer => mtaal
2018-09-11 20:07 mtaal Note Added: 0106693
2018-10-01 05:50 hgbot Checkin
2018-10-01 05:50 hgbot Note Added: 0107081
2018-10-01 05:50 hgbot Status new => resolved
2018-10-01 05:50 hgbot Resolution open => fixed
2018-10-01 05:50 hgbot Fixed in SCM revision => [^]
2018-10-01 05:50 mtaal Review Assigned To => AugustoMauch
2018-10-01 06:55 mtaal Note Edited: 0107081 View Revisions
2018-10-16 16:12 AugustoMauch Note Added: 0107339
2018-10-16 16:12 AugustoMauch Status resolved => closed
2018-10-24 09:27 guillermogil Note Added: 0107540
2018-10-24 09:27 guillermogil Status closed => new
2018-10-24 09:27 guillermogil Resolution fixed => open
2018-11-14 11:07 mtaal Relationship added related to 0039625
2018-11-14 11:42 mtaal Note Added: 0107903
2018-11-14 11:44 mtaal Note Edited: 0107903 View Revisions
2018-12-01 19:52 mtaal Status new => acknowledged
2018-12-01 19:54 mtaal Review Assigned To AugustoMauch => aaroncalero
2018-12-01 19:54 mtaal Status acknowledged => scheduled
2018-12-01 19:54 mtaal Note Added: 0108206
2018-12-01 19:54 mtaal Status scheduled => resolved
2018-12-01 19:54 mtaal Resolution open => fixed
2018-12-09 22:07 mtaal Review Assigned To aaroncalero => AugustoMauch
2018-12-10 16:19 AugustoMauch Note Added: 0108368
2018-12-10 16:19 AugustoMauch Status resolved => closed

Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker