Page MenuHomePhabricator

[services] Tunnelbroker - Adding of handling of the `NewNotifyToken` message
ClosedPublic

Authored by max on Nov 4 2022, 7:39 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jun 27, 8:09 AM
Unknown Object (File)
Tue, Jun 25, 11:55 PM
Unknown Object (File)
Tue, Jun 25, 11:55 PM
Unknown Object (File)
Tue, Jun 25, 11:55 PM
Unknown Object (File)
Tue, Jun 25, 11:55 PM
Unknown Object (File)
Tue, Jun 25, 11:55 PM
Unknown Object (File)
Tue, Jun 25, 11:55 PM
Unknown Object (File)
Tue, Jun 25, 11:54 PM

Details

Summary

This diff introduces handling by the gRPC server of the NewNotifyToken message message from the client in the MessagesStream bidirectional stream.

When the client sends the new notification token the server should save it for the client in the database sessions table.

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.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

max held this revision as a draft.
max edited the test plan for this revision. (Show Details)
max added reviewers: marcin, varun. max added 1 blocking reviewer(s): jon.
services/tunnelbroker/src/server/mod.rs
173–174 ↗(On Diff #18080)

Tonic forces us to provide all the implementations for the oneof gRPC messages otherwise the build will fail.
Handling of these oneof messages will be added as a follow-up diffs.

jon requested changes to this revision.Nov 4 2022, 11:02 AM

otherwise LGTM

services/tunnelbroker/src/server/mod.rs
167 ↗(On Diff #18080)

here as well

179 ↗(On Diff #18080)

should use logging instead of stderr

This revision now requires changes to proceed.Nov 4 2022, 11:02 AM

Changes to use error macro from tracing crate.
Rebased on master changes.

max added inline comments.
services/tunnelbroker/src/server/mod.rs
179 ↗(On Diff #18080)

should use logging instead of stderr

This should be the actual error because in this case, something is wrong with the database, but I agree that we should use tracing instead.
I've made changes to use error! from tracing where errors should be raised.

max marked an inline comment as done.

Rebasing on parent changes.

Rebasing on parent changes.

This revision is now accepted and ready to land.Nov 9 2022, 11:02 AM
This revision now requires review to proceed.Nov 10 2022, 2:15 AM
tomek added inline comments.
services/tunnelbroker/src/server/mod.rs
179 ↗(On Diff #18080)

Shouldn't we somehow inform the client that an attempt to set a token failed?

This revision is now accepted and ready to land.Nov 10 2022, 8:26 AM
max marked an inline comment as done.

Adding of the internal error to the client in case of the error on updating the token in a database.
Rebasing and fix merge conflicts.

services/tunnelbroker/src/server/mod.rs
179 ↗(On Diff #18080)

Shouldn't we somehow inform the client that an attempt to set a token failed?

Makes sense to return an internal error to the client. I've added returning of the gRPC Internal error in this case. Thanks, @tomek!

This revision was landed with ongoing or failed builds.Nov 21 2022, 5:27 AM
This revision was automatically updated to reflect the committed changes.