tsgrp / HPI

OpenContent Management Suite (OCMS)
http://www.tsgrp.com/products
17 stars 5 forks source link

Reduce frequency of userpreference save calls #2413

Closed dhruvvora94 closed 3 years ago

dhruvvora94 commented 3 years ago

Currently, the application makes a save user preferences call in many situations. These calls are throttled to go out only once a minute in most cases.

With this new revamp - we will make sure that the user preferences are stored in the browser and updated as the user interacts with the application. The save call should only go out at the end of the session to make sure the latest changes are stored in the repo.

Scenarios where the user preference save call is made

Other items needed to clean up user preferences -

dhruvvora94 commented 3 years ago

Closed with OC commit 26825 and OCMS commit 26401

USER PREFERNCES - Making changes to reduce the number of save calls being made. We are only making save calls now when the user has finished using the application.

Depends on OC commit - 26825

USER PREFERENCES - Changing the error codes that are sent back based on the error. If we cant find the userpreferences object we will send back a 404 and all other errors will result in a 500.

We are also locking the userpreferences object in the repo before saving it in order to prevent any collisions.

CR - aking, nreiman

gsteimer commented 3 years ago

Reopening this - seems like logout is always failing with the following error:

image

dhruvvora94 commented 3 years ago

Closed with ocms commit # 26405

USERPREFERENCES - There was an issue with the previous commit where the logoff functionality was not working as expected. Making some changes here to use a regular POST call instead of the sendBeacon method on logoff to allow for some coordination between different network calls.

https://github.com/tsgrp/HPI/issues/2413

CR - aking, abrown

Adding some ideas for further enhancements to - https://github.com/tsgrp/HPI/issues/2415

gsteimer commented 3 years ago

Alfresco seems fine, but this is still failing on both Documentum and Hbase. See the errors below:

Dctm - 501 error in OC on Logout:

2021-04-29 11:43:03,718 ajp-nio-9009-exec-1 ERROR   RESTService Method IContent#unlockDocument, has not yet been implemented for DCTM.
com.tsgrp.opencontent.core.exception.OCNotSupportedException: Method IContent#unlockDocument, has not yet been implemented for DCTM.
    at com.tsgrp.opencontent.dctm.content.DCTMContentImpl.unlockDocument(DCTMContentImpl.java:1830) ~[oc-hpiDemoDctm.2.dctm-3.4.2.jar:3.4.2]
    at com.tsgrp.opencontent.core.preferences.GenericPreferencesService.updatePreferencesByName(GenericPreferencesService.java:298) ~[oc-hpiDemoDctm.1.core-3.4.2.jar:3.4.2]
    at com.tsgrp.opencontent.core.userpreferences.persistence.RESTUserPreferencesService.saveUserPreference(RESTUserPreferencesService.java:158) ~[oc-hpiDemoDctm.3.hpi-3.4.2.jar:3.4.2]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]

Hbase - javascript error on logout:

image

dhruvvora94 commented 3 years ago

Issues for Documentum should be resolved with OC commit 26829

USER PREFERENCES - The lock and unlock functionality is not implemented for Documentum - adding in some error handling to make sure that saves still go through even for DCTM.

https://github.com/tsgrp/HPI/issues/2413

CR - aking, abrown

dhruvvora94 commented 3 years ago

Issues for HBase resolved with OCMS commit 26408

USERPREFRENCES - Logging out on hbase was causing issues since it uses localstorage to store the user preferences. Making some changes to make sure that logoff works for all repos.

https://github.com/tsgrp/HPI/issues/2413

CR - aking, abrown