Page MenuHomePhabricator

[Tunnelbroker] use `MessageToDevice` in RabbitMQ queue
ClosedPublic

Authored by kamil on Oct 24 2023, 9:59 AM.
Tags
None
Referenced Files
F2895571: D9573.diff
Fri, Oct 4, 6:31 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:01 AM
Unknown Object (File)
Tue, Sep 10, 1:44 AM
Unknown Object (File)
Sat, Sep 7, 1:50 AM
Unknown Object (File)
Aug 24 2024, 3:38 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