Constant autopush_common::MAX_NOTIFICATION_TTL

source ·
pub const MAX_NOTIFICATION_TTL: u64 = _; // 2_592_000u64
Expand description

Define some global TTLs.

RFC8030 notes that technically these are u32 values, but we should be kind and use u64. The RFC also does not define a maximum TTL duration. Traditionally, Autopush has capped this to 60 days, partly because we used to require monthly message table rotation. (The TTL was given an extra 30 days grace in order to handle dates near the turn of the month, when we might need to look in two tables for the data.) Since we now have automatically applied garbage collection, we are at a bit of liberty about how long these should be.

That gets back to the concept that Push messages are supposed to be “timely”. A user may not appreciate that they have an undelivered calendar reminder from 58 days ago, nor should they be interested in a meeting alert that happened last month. When a User Agent (UA) connects, it recieves all pending messages. If a user has not used the User Agent in more than 60 days, the User Agent suggest “refreshing Firefox”, which essentially throws away one’s current profile. This would include all subscriptions a user may have had.

To that end, messages left unread for more than 30 days should be considered “abandoned” and any router info assigned to a User Agent that has not contacted Autopush in 60 days can be discarded.

The maximum TTL for notifications, 30 days in seconds