Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce UserBase3 #17

Open
jace opened this issue Nov 25, 2015 · 0 comments
Open

Introduce UserBase3 #17

jace opened this issue Nov 25, 2015 · 0 comments

Comments

@jace
Copy link
Member

jace commented Nov 25, 2015

The UserBase and UserBase2 classes store user data that is not guaranteed up to date with Lastuser. Data is refreshed when:

  1. The user logs into the app.
  2. Lastuser sends a push notification about some piece of data changing (except the notifications aren't thorough and miss events like Team membership).

If a push notice was missed and the user does not re-login, data is not refreshed, even if the user is active on the app.

Since both base classes introduce columns with unique constraints, this adds overhead for ensuring the current user's data does not conflict with another user's. We therefore bump off data from the other user's record and wait for them to re-login to refresh.

This is extremely messy and becomes even more complicated with the Team model where a team has users as members, but membership detail is only available via the User record's access token, so there is no way for a client app to receive authoritative data on team membership.

Flask-Lastuser should introduce a new UserBase3 base class that has only userid and access_token columns. Everything else should be loaded on demand from Lastuser, via a cache, and push notifications from Lastuser should only flush this cache. Further, as a "network" effect on multiple apps hosted on the same server, the cache should be machine-local and not app-local, so the same data isn't cached multiple times across apps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant