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)
Sat, Nov 9, 9:42 AM
Unknown Object (File)
Sat, Nov 9, 9:20 AM
Unknown Object (File)
Sat, Nov 9, 5:12 AM
Unknown Object (File)
Sat, Nov 9, 4:46 AM
Unknown Object (File)
Fri, Oct 18, 9:02 PM
Unknown Object (File)
Oct 5 2024, 9:35 PM
Unknown Object (File)
Oct 5 2024, 7:46 PM
Unknown Object (File)
Oct 4 2024, 7:45 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.