A previous firebase sender service used XMPP protocol to send push notifications. This migration is about replacing XMPP with a new HTTP implementation. This type of migration is motivated by the fact that XMPP is a deprecated protocol and it is not recommended to use it anymore. The new HTTP implementation is more reliable and easier to maintain. After rewriting the sender service with the latest firebase admin SDK, message payloads were changed, thus directory messages service was also updated to prepare messages with the new format.
First steps
- Update the sender service to the version >= 1.13.4.0
- Update the directory messages service to the version >= 1.68.0.1
- Get a list of all firebase accounts that are used in a specific sender location
- attach to the sender service container
- execute script to get a list of all firebase accounts queues
./get_queues - Ensure to clean messages queue in Redis for all related firebase accounts to avoid sending old messages with the old format
from itertools import product
from apps.messages.models import FirebaseSpamMessages, FirebaseMessages
for spam, firebase_app in product([True, False], ['04a4177e-d2a0-4372-bd59-0a417597e5a3']):
print(f"Clearing messages container for {firebase_app} ({'spam' if spam else 'regular'})")
container = FirebaseSpamMessages(firebase_app=firebase_app) if spam else FirebaseMessages(firebase_app=firebase_app)
container.reset()