Description

This feature aims on detecting users that were not reachable for a while, thus allowing to optimize the delivery of push notifications to them.

How it works

First, directory-reach-detector service creates a sent snapshot when a group of messages is being sent to subscribers. It will mark the fact of delivery with a correspondent list of users that supposed to receive the message. directory-reach-detector also keeps track of all users callbacks signalizing that the message was delivered.

After time has passed, it is time for directory-reach-extractor to do the job of comparing sent snapshot with a list of users that actually received the message.

All users that were not reachable during this period, will be put into a queue that will be later composed into offline package and be available for downloading via directory-api endpoint.

Returning back to online

There are actually two ways how user can return back to online:

  • either by sending an awake message callback to callback-api (will be triggered if a certain amount of time has passed since the last message received)
  • or by reaching with a go-ping service

Both ways will immediately remove user from current offline package while also emitting a subscriber-update-event-sql record that will be replicated to all on-premises locations for subscribers-cache service to exclude user from the local offline package as well.