qri-io / qri

you're invited to a data party!
https://qri.io
GNU General Public License v3.0
1.11k stars 66 forks source link

All mutations to the owner profile must pass through `profile.Store.SetOwner()` #1884

Open b5 opened 3 years ago

b5 commented 3 years ago

1882 adds context to the Owner(ctx) method. In an ideal world profile store implementations should be required to store the canonical "Owner" profile in memory, removing the need for any fetching, and by extension the need for a context argument.

We should audit the codebase for owner mutations, return a copy of the profile.Profile in the ProfileStore.Owner() getter method, and add a spec test that assures ProfileStore implementations behave properly with regard to the owner.

Stretch goal: all profile mutations pass through the profile store.