HomePhabricator
Diffusion Comm 55b63f0d515b

[services] Tunnelbroker - Adding of requesting a new notification token if empty

Description

[services] Tunnelbroker - Adding of requesting a new notification token if empty

Summary:
This diff introduces the handling of requesting the new notification token from the client in case if the token is empty.
When the Tunnelbroker sends a push notification to the device, the notification token can be wrong or expired.
In this case, we are making the token empty for a certain device/session and requesting the new token from the client using the NewNotifyTokenRequired message.
Handling of the new token from the client in D5534.

Linear task: ENG-2060

Test Plan:

  • Connect to the bidirectional gRPC MessagesStream stream with the valid sessionID in metadata and send the message to the server with the NewNotifyToken field value as a random string. The expected behavior is that the value will be written into the sessions table of the dynamoDB database into the NotifyToken field;
  • Make the NotifyToken field empty in a record with your sessionID key;
  • Re-connect to the bidirectional gRPC MessagesStream;

The expected behavior is your client will receive a newNotifyTokenRequired message to require the new token from the device which must be sent as NewNotifyToken message and will be handled in the D5534 diff.

Reviewers: jon, varun, marcin, tomek

Reviewed By: jon, tomek

Subscribers: ashoat, tomek, atul, abosh

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