Description
DefHandler.user_for_conf_snippet saves a change to the user.app_type for backend actions such as batch triggers being fired. If the same user is logged in to the UI (although we recommend the use of specific service user accounts for backend actions), the user's session will be disrupted, since the change will lead to a new app type being used by the front end.
In most cases, the use of this method should not require a persisted change to the user.app_type, just a change within memory. The aim is to identify all uses of this method, generate tests for the current functionality that ensures the correct user app type is used, then change the method to remove the user.save persistence of the user.app_type change. The tests should continue to pass, or if not we should identify the scope of changes needed to resolve the issue.
It is possible that any situations that require role or user access control lookups may require adjustment, since they query the database directly. Calls to methods that perform these lookups may need to specify an "alternative app type" for them to work appropriately.
Description
DefHandler.user_for_conf_snippetsaves a change to theuser.app_typefor backend actions such as batch triggers being fired. If the same user is logged in to the UI (although we recommend the use of specific service user accounts for backend actions), the user's session will be disrupted, since the change will lead to a new app type being used by the front end.In most cases, the use of this method should not require a persisted change to the
user.app_type, just a change within memory. The aim is to identify all uses of this method, generate tests for the current functionality that ensures the correct user app type is used, then change the method to remove theuser.savepersistence of theuser.app_typechange. The tests should continue to pass, or if not we should identify the scope of changes needed to resolve the issue.It is possible that any situations that require role or user access control lookups may require adjustment, since they query the database directly. Calls to methods that perform these lookups may need to specify an "alternative app type" for them to work appropriately.