Skip to content

Use Scoped services more (and Transient services less) in app-lib? #751

@ivarne

Description

@ivarne

Description

Singleton services is perceived by developers as more efficient, because they don't need to be initialised for every request.

The big drawback is that transient service dependencies inherit their singleton scope, which is really bad if someone in a transient dependent service decide to store user data in a class variable causing it to be reused cross request. If service scope validation is configured, we get an exception when a singleton service references a scoped service, making these kind of issues way more obvious, if we used scoped services more.

Additional Information

No response

Tasks

No response

Acceptance Criterias

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/chorestatus/draftStatus: When you create an issue before you have enough info to properly describe the issue.status/triage

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions