Page MenuHomePhabricator

[Tunnelbroker] update DDB schema to handle client message ID
ClosedPublic

Authored by kamil on Oct 12 2023, 4:07 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 4, 7:45 AM
Unknown Object (File)
Wed, Oct 2, 4:59 PM
Unknown Object (File)
Wed, Oct 2, 1:06 PM
Unknown Object (File)
Wed, Oct 2, 1:06 PM
Unknown Object (File)
Wed, Oct 2, 1:06 PM
Unknown Object (File)
Wed, Oct 2, 6:18 AM
Unknown Object (File)
Wed, Oct 2, 6:01 AM
Unknown Object (File)
Wed, Oct 2, 3:53 AM
Subscribers

Details

Summary

Issue and context why we need this: ENG-5171.

Test Plan
  1. Send some messages and check if they're properly saved in DB:

image.png (199×2 px, 53 KB)

  1. Run test_messages_order to make sure:
  2. messages can be properly retrieved and deleted
  3. order is correct

Diff Detail

Repository
rCOMM Comm
Branch
tb-ddb
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kamil held this revision as a draft.
services/tunnelbroker/src/database/mod.rs
52 ↗(On Diff #31957)

Returned message_id is needed later in the stack

services/tunnelbroker/src/grpc/mod.rs
42 ↗(On Diff #31957)

the correct value here will be added in the next diff

services/tunnelbroker/src/websockets/session.rs
178 ↗(On Diff #31957)

the correct value here will be added in the next diff

kamil published this revision for review.Oct 12 2023, 8:13 AM
kamil added inline comments.
services/tunnelbroker/src/database/mod.rs
52 ↗(On Diff #31957)
services/tunnelbroker/src/grpc/mod.rs
42 ↗(On Diff #31957)
services/tunnelbroker/src/websockets/session.rs
178 ↗(On Diff #31957)
This revision is now accepted and ready to land.Oct 13 2023, 3:21 AM

It might be worth to introduce something like

struct MessageID {
  timestamp: DateTime<Utc>,
  client_message_id: String,
}

impl MessageID {
  pub fn new(client_message_id: String) -> Self {Self {timestmap: Utc::now(), client_message_id} }
}

And impls for converting to and from a string (timestamp#messageID)

This revision was landed with ongoing or failed builds.Oct 16 2023, 6:48 AM
This revision was automatically updated to reflect the committed changes.