Skip to content

ContactsViewModel shouldn't retrieve all users in the constructor #5637

@rapterjet2004

Description

@rapterjet2004

The ContactsViewModel is currently retrieving users on object creation

init {
      getContactsFromSearchParams()
}

which isn't inherently bad, but when used with our dependency injection setup, each @Inject creates a new instance of the class, which means that unnecessary network calls are made with entering activities that may rely on the functions exposed through the view model, but are not immediately requiring the entire contacts list of the user.

Metadata

Metadata

Assignees

No one assigned

    Labels

    1. to developAccepted and waiting to be taken care of (should be only set by nextcloud employees)bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions