Page MenuHomePhabricator

[Tunnelbroker] use `MessageToDevice` in RabbitMQ queue
ClosedPublic

Authored by kamil on Oct 24 2023, 9:59 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 9, 9:53 AM
Unknown Object (File)
Sat, Nov 9, 9:42 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, 5:28 AM
Unknown Object (File)
Oct 4 2024, 6:31 PM
Unknown Object (File)
Oct 2 2024, 1:06 PM
Subscribers

Details

Summary

Previously there was only payload, but we need to have messageID to send it to client.

Depends on D9572

Test Plan

Run Tunnelbroker tests (tests make sure clients still can properly read message content si it's enough to rely on it)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Oct 24 2023, 11:19 AM
kamil added inline comments.
services/tunnelbroker/src/websockets/mod.rs
174–175 ↗(On Diff #32342)

this is temporary (avoid tests failure) and is removed in next diff

bartek requested changes to this revision.Oct 25 2023, 3:43 AM

Besides one suggestion LGTM, let me know if this cannot be easily done

services/tunnelbroker/src/database/message.rs
15 ↗(On Diff #32342)

I don't like the naming here. I'd prefer MessageToDeviceExt but the best choice would be to replace this trait and the from_hashmap() with TryFrom

impl TryFrom<HashMap<String, AttributeValue>> for MessageToDevice {
  type Error = MessageErrors;

  fn try_from(
    hashmap: HashMap<String, AttributeValue>
  ) -> Result<Self, Self::Error> { ... }
This revision now requires changes to proceed.Oct 25 2023, 3:43 AM

rename to MessageToDeviceExt

services/tunnelbroker/src/database/message.rs
15 ↗(On Diff #32342)

This doesn't work because MessageToDevice is implemented in different crate, it is not really possible to move it.

Renaming this for now, but if you think it's not enough we can consider adding some kind of wrapper to MessageToDevice and implement TryFrom to this new struct - but not sure which solution is better here.

bartek added inline comments.
services/tunnelbroker/src/database/message.rs
15 ↗(On Diff #32342)

This doesn't work because MessageToDevice is implemented in different crate, it is not really possible to move it.

Ah yeah, I forgot about it. That one single thing I hate about rust

This revision is now accepted and ready to land.Oct 31 2023, 6:22 AM