Openbravo Issue Tracking System - POS2
View Issue Details
0057253POS2POSpublic2024-11-22 09:192024-11-28 15:18
victor_perez 
sreehari 
urgentmajoralways
closedfixed 
5
 
25Q1 
approved
OBPS
Production - Confirmed Stable
2024-07-19
https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/3b98aafeeaa3a836d09bf8f5bc66c5be4879afeb [^]
No
0057253: Not possible to login to the POS with the offline mode
When you have a till loaded, if you activate the offline mode, you will not be able to login again.

The error is thrown from the funtion "loginInitActions", then the line of code "await initializeDocumentSequence();" and finally in the "doFetch" from the screenshot.

You can reproduce it in livebuilds.
1. Login a till with the online mode activated. IT MUST BE A TILL THAT HAS NOT DONE ANY ORDER (thus the "sequence" value of the main orders document type must have value "0")
2. Once the till is fully loaded, log out
3. Activate the offline mode using Chrome tools
4. Log in to the till
5. An error will appear with the message "This action is not allowed in offline mode"
The problem seems to be in this line:

https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/3b98aafeeaa3a836d09bf8f5bc66c5be4879afeb#f4d041f0b1c18efe7cf1078a093ace355ae7efb7_141_145 [^]

The problem is that if sequenceNumber is 0, then the expression

 if (!DocumentSequence?.lastassignednum?.sequenceNumber) {

I suppose we can instead check if sequenceNumber is undefined, and only then try to load the terminal. In any case, I think most probably still we need to surround that part with a try/catch, although most probably in the case it is undefined we are already screwed and even if we attempt to login offline, we will probably fail so this part must also be checked.
No tags attached.
depends on backport 005728724Q4 closed sreehari Not possible to login to the POS with the offline mode 
depends on backport 005728824Q3.3 closed sreehari Not possible to login to the POS with the offline mode 
depends on backport 005728924Q2.5 closed sreehari Not possible to login to the POS with the offline mode 
caused by defect 0056070 closed sreehari When sequenceNumber is undefined we get it from terminal and we get DocumentNo duplicated 
png Screenshot from 2024-11-22 09-06-13.png (237,120) 2024-11-22 09:19
https://issues.openbravo.com/file_download.php?file_id=20547&type=bug
png
Issue History
2024-11-22 09:19victor_perezNew Issue
2024-11-22 09:19victor_perezAssigned To => Retail
2024-11-22 09:19victor_perezFile Added: Screenshot from 2024-11-22 09-06-13.png
2024-11-22 09:19victor_perezOBNetwork customer => OBPS
2024-11-22 09:19victor_perezTriggers an Emergency Pack => No
2024-11-22 09:19victor_perezDescription Updatedbug_revision_view_page.php?rev_id=28813#r28813
2024-11-22 12:45marvintmTypedesign defect => defect
2024-11-22 12:56dmitry_mezentsevIssue Monitored: dmitry_mezentsev
2024-11-25 07:47marvintmNote Added: 0172510
2024-11-25 07:47marvintmStatusnew => feedback
2024-11-25 08:40victor_perezNote Added: 0172517
2024-11-25 11:49alostaleAssigned ToRetail => Triage Platform Conn
2024-11-25 11:49alostaleAssigned ToTriage Platform Conn => Triage Platform Base
2024-11-25 17:08victor_perezNote Added: 0172562
2024-11-26 13:12javietxeIssue Monitored: javietxe
2024-11-26 17:16marvintmAssigned ToTriage Platform Base => sreehari
2024-11-26 17:16marvintmStatusfeedback => new
2024-11-26 17:17marvintmRegression level => Production - Confirmed Stable
2024-11-26 17:17marvintmRegression date => 2024-07-19
2024-11-26 17:17marvintmRegression introduced by commit => https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/3b98aafeeaa3a836d09bf8f5bc66c5be4879afeb [^]
2024-11-26 17:17marvintmSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=28825#r28825
2024-11-26 17:18marvintmNote Added: 0172624
2024-11-26 17:18marvintmStatusnew => scheduled
2024-11-26 17:18marvintmSeveritycritical => major
2024-11-26 17:18marvintmSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=28826#r28826
2024-11-26 17:21marvintmSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=28827#r28827
2024-11-26 17:21marvintmProposed Solution updated
2024-11-27 06:05sreehariRelationship addedcaused by 0056070
2024-11-27 12:24hgbotMerge Request Status => open
2024-11-27 12:24hgbotNote Added: 0172632
2024-11-27 17:18hgbotMerge Request Statusopen => approved
2024-11-27 17:19hgbotNote Added: 0172644
2024-11-27 17:19hgbotResolutionopen => fixed
2024-11-27 17:19hgbotStatusscheduled => closed
2024-11-27 17:19hgbotFixed in Version => 25Q1
2024-11-27 17:19hgbotNote Added: 0172645
2024-11-27 18:00marvintmNote Added: 0172653
2024-11-27 18:00marvintmStatusclosed => new
2024-11-27 18:00marvintmResolutionfixed => open
2024-11-27 18:00marvintmFixed in Version25Q1 =>
2024-11-28 15:17marvintmNote Added: 0172727
2024-11-28 15:17marvintmStatusnew => scheduled
2024-11-28 15:17marvintmStatusscheduled => resolved
2024-11-28 15:17marvintmFixed in Version => 25Q1
2024-11-28 15:17marvintmResolutionopen => fixed
2024-11-28 15:18marvintmStatusresolved => closed

Notes
(0172510)
marvintm   
2024-11-25 07:47   
Although it was initially reproducible, once I updated Chrome browser it seems it is not reproducing. Is it the same to you?
(0172517)
victor_perez   
2024-11-25 08:40   
Even with the update of Chrome browser, I continue to reproduce it (Not in livebuilds but yes in 24Q3)
(0172562)
victor_perez   
2024-11-25 17:08   
It seems that for NOZ (24Q4) they have the same issue. Steps to reproduce:

1- with the wifi on, log in with a user with admin credentials
2- log out
3- Toggle the wifi off
4- log in with a user with admin credentials -> ok
5- log out
6- toggle the wifi on
7- log in with a user with the role seller
8- log out
9- toggle the wifi off
10- log in with a user with the role seller -> ko
(0172624)
marvintm   
2024-11-26 17:18   
In order to reproduce the issue, it must be tested in a terminal which hasn't yet done any order
(0172632)
hgbot   
2024-11-27 12:24   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/3162 [^]
(0172644)
hgbot   
2024-11-27 17:19   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/3162 [^]
(0172645)
hgbot   
2024-11-27 17:19   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: 6033f579f6b450f424b75235a7ecf4a4af8c8983
Author: Sreehari Venkataraman <sreehari.venkataraman.ext@openbravo.com>
Date: 27-11-2024 16:18:55
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/6033f579f6b450f424b75235a7ecf4a4af8c8983 [^]

Fixes ISSUE-57253: Added Undefined checks and try catch blocks

---
M web-jspack/org.openbravo.pos2/src/authentication/loginInitActions.js
---
(0172653)
marvintm   
2024-11-27 18:00   
We need to adjust the fix as it doesn't work in some cases
(0172727)
marvintm   
2024-11-28 15:17   
Finally we have confirmed that solution is correct