We want to limit the number of duplicate notifications sent to phone numbers. Instead of randomly picking from the notification list, which could result in the same notification sending consecutively, send the notifications one after the other.
This will require a new field in the MongoDB collection, something like lastNotificationIndex. When the next notification is sent, increment lastNotificationIndex and send the notification at that index.
There could be other ways to go about this, I'm open to suggestions.
We want to limit the number of duplicate notifications sent to phone numbers. Instead of randomly picking from the notification list, which could result in the same notification sending consecutively, send the notifications one after the other.
This will require a new field in the MongoDB collection, something like
lastNotificationIndex. When the next notification is sent, incrementlastNotificationIndexand send the notification at that index.There could be other ways to go about this, I'm open to suggestions.