Duplicate Push Token Device Deletion
Description
The duplicate push token device deletion contains two workers:
-
Checker
-
Cleanup
Checkers job is to check data from every new message published to client-state-push-token-updates topic using me-push-duplicate-push-token-checker subscription.
Each message with pushToken present it is checked for duplicates in DynamoDB. In case of multiple entries found for pushToken every previous device is mapped in a way that it publishes
a message to client-state-contact-updates and client-state-push-token-updates topics with null pushToken (and contact) values.
It also publishes a message with pushToken to delete and uidToKeep to skip deletion to push-token-duplicates topic.
Cleanup worker is subscribed to me-push-duplicate-push-token-checker subscription and it’s job is to delete devices from DynamoDB. If deletion fails for some reason message is nacked and therefore retryed.