mozilla-services / autopush-rs

Push Server in Rust
Mozilla Public License 2.0
197 stars 15 forks source link

Enforce a max number of channels (subscriptions) per user #733

Open data-sync-user opened 1 month ago

data-sync-user commented 1 month ago

https://mozilla-hub.atlassian.net/browse/SYNC-4221 will begin updating TTL records for every entry in the router column family so we can enable Bigtable’s garbage collection of router data. Under Bigtable, when updating the TTL (when a user conducts some form of activity) we need to first read the contents of that router row, then write the contents out again with new TTLs (cell timestamps).

We currently do not enforce any kind of limit of the number of channels (subscriptions) a user can have. Especially with the added work of needing to read all the channels out and then write them again with the new timestamp, we should begin enforcing some kind of maximum limit of channels to limit the work required. Also any user exceeding such a limit is likely either misconfigured or abusing our system.

The enforcement of the max should simply drop the user record, forcing them to recreate a fresh one.

┆Issue is synchronized with this Jira Task

data-sync-user commented 1 month ago

➤ Philip Jenvey commented:

What should be the maximum? 100? 1000?

data-sync-user commented 1 month ago

➤ JR Conlin commented:

Hrm. We could probably add a metric to the mobile channel check and the desktop “hello” to get an idea of the median number of channels a given UAID may have.