Skip to content

Saving change to user app type unnecessarily #1223

@philayres

Description

@philayres

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.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions