Openbravo Issue Tracking System - Retail Modules |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0050321 | Retail Modules | Web POS | public | 2022-09-23 12:00 | 2022-10-21 13:02 |
|
Reporter | aferraz | |
Assigned To | caristu | |
Priority | normal | Severity | major | Reproducibility | have not tried |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | | Fixed in Version | RR23Q1 | |
Merge Request Status | |
Review Assigned To | |
OBNetwork customer | |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0050321: LoginDataProvider.getData overwrites data defined for the same property instead of merging it |
Description | The MobileCoreLoginUtilsServlet generates a JSON object as the the response data with information that is loaded in the POS during the login process.
The LoginDataProvider hooks are intended to add custom data (with external modules) into that JSON object. But currently they do not support appending information into the inner JSON properties of the response data: they now can just overwrite it. This prevents including some information properly in the response data.
|
Steps To Reproduce | - Implement LoginDataProvider.getData and return a Map with "terminal" as key and any JSONObject as value.
- Clean the cache in ReactPOS and login -> You get following error: Cannot read properties of undefined (reading 'minutestorefreshdatatotal') -> This is caused because the LoginDataProvider hook is overwriting the terminal data that is previously generated by the MobileCoreLoginUtilsServlet. |
Proposed Solution | Attached a fix to do a first level merge of properties with a JSONObject value.
Check if we should do a deep merge.
Check if other type of values like JSONArray should be also merged.
An example that would need this fix can be found here: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.sessions/-/merge_requests/43/diffs#1acedf184c743325e8df5d4acaa0404b719cff2d_0_29 [^] |
Additional Information | |
Tags | No tags attached. |
Relationships | related to | defect | 0050602 | | closed | caristu | Retail Modules | API Change: LoginDataProvider extends Prioritizable | related to | defect | 0056065 | | closed | Triage Platform Base | POS2 | MobileCoreLoginUtilsServletTest.extraLoginDataIsMerged test fails | blocks | feature request | 0050230 | | closed | aferraz | Retail Modules | Implement open/close store process in ReactPOS |
|
Attached Files | 50321.diff (1,388) 2022-09-23 12:03 https://issues.openbravo.com/file_download.php?file_id=17547&type=bug |
|
Issue History |
Date Modified | Username | Field | Change |
2022-09-23 12:00 | aferraz | New Issue | |
2022-09-23 12:00 | aferraz | Assigned To | => Triage Platform Base |
2022-09-23 12:00 | aferraz | Triggers an Emergency Pack | => No |
2022-09-23 12:03 | aferraz | File Added: 50321.diff | |
2022-10-18 17:28 | caristu | Assigned To | Triage Platform Base => caristu |
2022-10-20 10:37 | hgbot | Note Added: 0142330 | |
2022-10-20 10:49 | hgbot | Note Added: 0142331 | |
2022-10-21 08:26 | aferraz | Relationship added | blocks 0050230 |
2022-10-21 10:13 | caristu | Description Updated | bug_revision_view_page.php?rev_id=24951#r24951 |
2022-10-21 10:13 | caristu | Steps to Reproduce Updated | bug_revision_view_page.php?rev_id=24953#r24953 |
2022-10-21 10:13 | caristu | Proposed Solution updated | |
2022-10-21 10:19 | caristu | Issue cloned | 0050602 |
2022-10-21 10:19 | caristu | Relationship added | related to 0050602 |
2022-10-21 12:24 | hgbot | Note Added: 0142400 | |
2022-10-21 12:24 | hgbot | Note Added: 0142401 | |
2022-10-21 12:24 | hgbot | Note Added: 0142402 | |
2022-10-21 12:25 | hgbot | Note Added: 0142405 | |
2022-10-21 12:25 | hgbot | Resolution | open => fixed |
2022-10-21 12:25 | hgbot | Status | new => closed |
2022-10-21 12:25 | hgbot | Fixed in Version | => RR23Q1 |
2022-10-21 12:25 | hgbot | Note Added: 0142406 | |
2022-10-21 13:02 | hgbot | Note Added: 0142414 | |
2024-07-19 10:18 | caristu | Relationship added | related to 0056065 |
Notes |
|
(0142330)
|
hgbot
|
2022-10-20 10:37
|
|
|
|
(0142331)
|
hgbot
|
2022-10-20 10:49
|
|
|
|
(0142400)
|
hgbot
|
2022-10-21 12:24
|
|
|
|
(0142401)
|
hgbot
|
2022-10-21 12:24
|
|
|
|
(0142402)
|
hgbot
|
2022-10-21 12:24
|
|
|
|
(0142405)
|
hgbot
|
2022-10-21 12:25
|
|
|
|
(0142406)
|
hgbot
|
2022-10-21 12:25
|
|
Directly closing issue as related merge request is already approved.
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core [^]
Changeset: fcc132ab328df65978ac249d930495c86e4d3307
Author: Carlos Aristu <carlos.aristu@openbravo.com>
Date: 21-10-2022 10:24:25
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/commit/fcc132ab328df65978ac249d930495c86e4d3307 [^]
fixes BUG-50321: merge JSON properties for extra login data
Now it is possible to merge information coming from LoginDataProvider
hooks in JSON properties. Before this change, if the property already
existed in the result it was being overridden with the value returned
from the hook.
Together with this, now the LoginDataProvider implements the
Prioritizable interface so it is possible to define an order, if
desired, to add the custom information from the hooks.
---
A src-test/org/openbravo/mobile/core/login/MobileCoreLoginUtilsServletTest.java
A src-test/org/openbravo/mobile/core/login/TestLoginDataProvider.java
M src/org/openbravo/mobile/core/login/LoginDataProvider.java
M src/org/openbravo/mobile/core/login/MobileCoreLoginUtilsServlet.java
---
|
|
|
(0142414)
|
hgbot
|
2022-10-21 13:02
|
|
|