Openbravo Issue Tracking System - POS2
View Issue Details
0055211POS2Corepublic2024-04-16 14:302024-04-16 14:30
alostale 
Triage Platform Base 
normalmajorhave not tried
newopen 
5
 
 
No
0055211: cannot toggle dark theme with audit trail active
If audit trail is enabled for at least one table. Trying to toggle pos theme from dark to light or in the other way around fails and an import entry is kept in Initial status forever.
1. Log in BO as System Admin
2. In Tables and Columns, select any table and set it as fully audited
3. Compile and restart Tomcat
4. Log in POS2
5. Toggle Theme Mode
6. Log out and log in again with the same user as in step 4
  -> ERROR: the theme mode is the same as before step 5, it should remain as it was set in step 5
     In openbravo.log you can see:

2024-04-16 14:01:45,562 [Import Entry - 1] ERROR org.openbravo.database.SessionInfo - Error setting audit info
org.postgresql.util.PSQLException: ERROR: value too long for type character varying(32)

The problem comes from AD_CONTEXT_INFO.PROCESSID column with a length of 32 characters, in this case OBPOS2_UpdateTerminalTypeUserConfiguration is tried to be inserted.

Possible solutions:
1. Change the value returned by TerminalTypeUserConfigurationLoaderProcessor.getProcessIdForAudit to something with a proper size. To be consistent IE type should be renamed accordingly. This might have a theoretical impact in not being able to process this type of entries that weren't processed before the update (small risk)
2. Increase AD_CONTEXT_INFO.PROCESSID size up to 60 which is the size of ad_ref_list_value.value column where IE types are stored. We might need to look for potentially impacted areas.

If solution 1 is done, it might be convenient to add some validation/test to ensure there is no new IE types bigger than 32 chars.

Which currently is not the case, at least in the base retail modules:

ret=> select value, length(value) from ad_ref_list where ad_reference_id = '11F86B630ECB4A57B28927193F8AB99D' and length(value)>32 order by 2 desc;
                   value | length
--------------------------------------------+--------
 OBPOS2_UpdateTerminalTypeUserConfiguration | 42
(1 row)
No tags attached.
caused by feature request 0053175 closed meriem_azaf [React POS] Toggle between Dark and Light Theme 
Issue History
2024-04-16 14:30alostaleNew Issue
2024-04-16 14:30alostaleAssigned To => Triage Platform Base
2024-04-16 14:30alostaleTriggers an Emergency Pack => No
2024-04-16 14:30alostaleRelationship addedcaused by 0053175

There are no notes attached to this issue.