HomePhabricator
Diffusion Comm 18ef8636ed87

[services] Tunnelbroker - Adding delivering of undelivered messages from the…

Description

[services] Tunnelbroker - Adding delivering of undelivered messages from the database to the messages stream

Summary:
This diff adds delivery of the undelivered messages from the database to the client when connecting to the bidirectional stream.
When the client is offline the messages to deliver are stored in the database. Right after the client is online and connected to the messages bidirectional stream we will deliver messages from the database to the client as messagesToDeliver.

The client will process messages and send back processed messages IDs to the Tunnelbroker as processedMessages only after that, we will delete messages from the database.

Removing of processed messages implemented in D5584.

Linear task: ENG-2060

Test Plan:

  1. Insert a message into the messages table with the corresponding deviceID in the toDeviceID field.
  2. Connect by the gRPC client to the bidirectional stream with the sessionID corresponding to the deviceID in metadata.

The expected result is that the message from the database would be delivered to the client as the MessagesToDeliver.

Reviewers: jon, varun, marcin, tomek

Reviewed By: jon, tomek

Subscribers: ashoat, tomek, atul, abosh

Differential Revision: https://phab.comm.dev/D5540