Openbravo Issue Tracking System - POS2
View Issue Details
0055974POS2Corepublic2024-07-11 09:372024-07-15 11:28
AugustoMauch 
ablasco 
normalmajorhave not tried
newopen 
5
 
 
No
0055974: An exception on a OnAppRenderAction will result in others not being executed, application starting "normally"
Developers can define functions as OnAppRenderActions, that will be executed once the application is initially rendered, before the user can interact with it.

If any of those functions throw an exception, the other OnAppRenderActions that would be executed after, won't be, and the application will start normally. The application should not start normally, as there might be relevant business logic in the OnAppRenderActions that were not executed
- Add an new OnAppRenderAction below this one: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/blob/master/web-jspack/org.openbravo.pos2/src/ob-init.js#L3311 [^]
- Put a breakpoint on the new OnAppRenderAction
- Log in vallblanca's with the current default POS role (VallBlancaUser). Check that the new OnAppRenderAction is executed (this is OK)
- Change vallblanca's default POS role to use VallBlancaManual. Log in again. Check that the new OnAppRenderAction is not executed (this is NOT OK). It is not executed because the openInitialCount threw an exception, because the VallBlancaManual role does not have access to a user action that is executed as part of that function.
- Wrap this code on a try/catch block: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/blob/master/web-jspack/org.openbravo.core2/src/components/App/App.jsx#L36 [^]
- If the catch block captures an exception, show its message using the askConfirmation API and then log out
- Contact the POS team so that they decide what should be done about the exception in the openInitialCount OnAppRenderAction
No tags attached.
Issue History
2024-07-11 09:37AugustoMauchNew Issue
2024-07-11 09:37AugustoMauchAssigned To => ablasco
2024-07-11 09:37AugustoMauchTriggers an Emergency Pack => No
2024-07-15 11:28hgbotNote Added: 0166967

Notes
(0166967)
hgbot   
2024-07-15 11:28   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/1543 [^]