owncloud / web

:dragon_face: Next generation frontend for ownCloud Infinite Scale
https://owncloud.dev/clients/web/
GNU Affero General Public License v3.0
418 stars 157 forks source link

[Web] make clientService more developer friendly #11107

Open kulmann opened 1 week ago

kulmann commented 1 week ago

Description

At the moment you can shoot yourself in the foot quite easily by destructuring the clientService (e.g. const { webdav } = useClientService(). The destructured respective client (here: webdav) will not a reactive authentication. Meaning that after a token renewal the destructured client will not have valid authentication anymore. See https://github.com/owncloud/web/pull/11068 for one of our own fallouts from this. Since destructuring objects is a quite common concept in the JS ecosystem we should avoid this pitfall.

User Stories

Value

DX

Acceptance Criteria

One of the following:

Definition of ready

Definition of done

AlexAndBear commented 6 days ago

Could we use getters for singleton instances here, or would that result in the same issue ?

dschmidt commented 5 days ago

I guess we can make every object reactive instead of only the "top level" one