Skip to content

Make device tokens unique #43

@jasonaowen

Description

@jasonaowen

It seems that our initial plan to allow for multiple users on the same device was misguided. iOS does not allow our app the degree of flexibility in handling messages and choosing to show or not show notifications that we expected from reading the Firebase documentation, and so we need to be more selective in what we send. More importantly, as the app does not support multiple users at this time, it can lead to the app receiving and displaying notifications for a user who is not signed in.

This was partially addressed in #36, by having the back-end call the new delete token endpoint on logout. @v-rusu pointed out in #38 that the delete endpoint cannot address all cases; we need to enforce uniqueness throughout. This includes:

  • Delete any current duplicates
  • Replace the primary key on devices to be only on (device_token)
  • Update the conflict handler
  • Add an updated_at column to add some visibility into when the device token was reassigned or last used.

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