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 and UserBase2 classes store user data that is not guaranteed up to date with Lastuser. Data is refreshed when:
The user logs into the app.
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.
The text was updated successfully, but these errors were encountered:
The UserBase and UserBase2 classes store user data that is not guaranteed up to date with Lastuser. Data is refreshed when:
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.
The text was updated successfully, but these errors were encountered: