You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The UserBase mixin introduces many fields with redundant data (full name, username, timezone, userinfo), all of which are also available from Lastuser. Usernames in particular even have unique constraints. Keeping this data in sync with Lastuser has been the cause of much grief over the past year. It was the primary motivation behind adding push notifications to Lastuser.
Which is a pity because this data is also almost never used. Funnel uses it to display names against proposals, but every other app uses the Profile object instead (or Channel or Workspace in some apps). Profiles aren't linked to a User object precisely because we didn't want any more grief from data being out of sync.
We should just drop all these redundant columns from UserBase. Since the data is still required from time to time, (a) the columns should be replaced with properties and (b) the properties should query Lastuser and cache the results.
Dropping columns will also make the User db model lighter, a point that is relevant given that our user count is growing and, the with the number of times we store this data across apps, data storage is growing exponentially.
Note that this cache potentially cannot be shared across apps as the data contained in each user record is dependent on the requested scope. This makes the cache somewhat less efficient and calls for us to consider compartmentalizing caching by scope -- the current userinfo fieldset isn't cleanly divided by scope.
The text was updated successfully, but these errors were encountered:
The User model can't be completely discarded because the lastuser access token needs to be saved. However, the Team model is unnecessary. Other models can directly store the Team userid and this can be mapped to a non-persistent Team object via an SQLAlchemy instrumented attribute.
The UserBase mixin introduces many fields with redundant data (full name, username, timezone, userinfo), all of which are also available from Lastuser. Usernames in particular even have unique constraints. Keeping this data in sync with Lastuser has been the cause of much grief over the past year. It was the primary motivation behind adding push notifications to Lastuser.
Which is a pity because this data is also almost never used. Funnel uses it to display names against proposals, but every other app uses the Profile object instead (or Channel or Workspace in some apps). Profiles aren't linked to a User object precisely because we didn't want any more grief from data being out of sync.
We should just drop all these redundant columns from UserBase. Since the data is still required from time to time, (a) the columns should be replaced with properties and (b) the properties should query Lastuser and cache the results.
Dropping columns will also make the User db model lighter, a point that is relevant given that our user count is growing and, the with the number of times we store this data across apps, data storage is growing exponentially.
Note that this cache potentially cannot be shared across apps as the data contained in each user record is dependent on the requested scope. This makes the cache somewhat less efficient and calls for us to consider compartmentalizing caching by scope -- the current userinfo fieldset isn't cleanly divided by scope.
The text was updated successfully, but these errors were encountered: