We persist ApplicationToken
s in a storage container that ShieldConfigurationExtension
has access to. In rare, cases all the ApplicationToken
s for a user seem to change.
We know this because the Application
parameter passed into configuration(shielding application: Application) -> ShieldConfiguration
function has a Token
that does not match (using ==
) any of the ones we are persisting in storage.
Interestingly, the persisted ones still work, so I don't believe storage has gotten corrupted or anything. We can use them to add or remove shields, we can use them to display labels of the apps they represent, etc. But they don’t match what’s passed into the ShieldConfiguration
extension. If the user goes into the FamilyPicker
at this point and selects an app of a token that we are already persisting, the FamilyPickerSelection
will have a token matching the new one that is passed into ShieldConfigurationExtension
, not the one we persisted when they last selected that app.
This leads me to believe the tokens are updated/rotated in some cases. When and why does this happen, and how can we handle it gracefully?