Firebase accounts and locations

Each location has it’s own set of firebase accounts it will be responsible for. Such accounts should be organized with groups which that can be attached to campaigns-consumer entities.

A consumer’s token will be used to fetch campaign_requests by manager-consumer service.

Firebase account changing it’s group

When a firebase account changes it’s group, a bunch of async tasks should happen on other services to start reflecting changes.

Manager Database Updates

FirebaseUpdatesHandler will detect changes based on ChangeLog logs and will set firebase_update_trigger Redis key with a current timestamp. Some services, like assistant rely on this key to keep their local firebase accounts cache upd to date.

Scheduler Interval Executor

Scheduler will start to mark new campaign_requests with a new group id, once firebase-creds-groups-cache is updated.

Manager Consumer

Consumer continues to receive campaign_requests for the groups it was assigned before. No changes here.

Manager Tasks Executor

Will start to consider firebase updates as soon as firebase-creds-groups-cache is updated (60 seconds max).

Directory Messages

Does not rely on firebase accounts updates. It fully trusts initiator-requests queue and all the data it receives from it. Each batch contains a firebase app UUID. Service will prepare a message for each subscriber and send it to corresponding queue

Go Sender

Listens to firebase-update-trigger Redis key that acts as a trigger for the service to update it’s internal cache of Firebase accounts it should be responsible for.

Assistant

firebase-update-trigger Redis key is also used here to reset the local cache and to indicate that it is mandatory to re-fetch available Firebase accounts from manager-api

Manager API

Will start consider updates for his firebase-chart accounts distribution as soon as firebase-creds-groups-cache is updated.

NOTE: firebase chart feature only cares about how different accounts are distributed across different top-level groups (which are defined in FirebaseGroup.parent). Unless account was moved to a different top-level group (moved from admin to private for example), there will be no changes in the distribution. It is important to understand that such changes are not supposed to happen, especially in automated mode.