Skip to content

Introduce UserBase3 #17

@jace

Description

@jace

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions