mirror of
https://github.com/logos-messaging/libchat.git
synced 2026-07-01 05:30:12 +00:00
Add logging to groupV2
This commit is contained in:
parent
8588a40f94
commit
c8d7b486f6
@ -33,6 +33,7 @@ use libchat::WakeupService;
|
|||||||
use prost::Message;
|
use prost::Message;
|
||||||
use rand::{self, Rng};
|
use rand::{self, Rng};
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
|
use tracing::info;
|
||||||
|
|
||||||
use crate::AccountId;
|
use crate::AccountId;
|
||||||
use crate::conversation::{ConversationIdRef, ExternalServices, ServiceContext};
|
use crate::conversation::{ConversationIdRef, ExternalServices, ServiceContext};
|
||||||
@ -87,9 +88,13 @@ impl BufferDs {
|
|||||||
/// Other event variants are ignored — they're not "things to send."
|
/// Other event variants are ignored — they're not "things to send."
|
||||||
fn retrive_welcome_event(&mut self, events: &[SessionEvent]) {
|
fn retrive_welcome_event(&mut self, events: &[SessionEvent]) {
|
||||||
for evt in events {
|
for evt in events {
|
||||||
|
info!(event = format!("{:?}", evt), "Event Loop");
|
||||||
|
|
||||||
if let SessionEvent::WelcomeReady(w) = evt {
|
if let SessionEvent::WelcomeReady(w) = evt {
|
||||||
self.welcomes.push(w.clone());
|
self.welcomes.push(w.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dbg!(&self.welcomes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,6 +106,14 @@ impl BufferDs {
|
|||||||
) -> Result<(), ChatError> {
|
) -> Result<(), ChatError> {
|
||||||
// Swap the Vec out; Own then existing and replace with a new empty vec.
|
// Swap the Vec out; Own then existing and replace with a new empty vec.
|
||||||
for pkt in self.queue.drain(..) {
|
for pkt in self.queue.drain(..) {
|
||||||
|
info!(
|
||||||
|
app = pkt.app_id.as_slice(),
|
||||||
|
convo = pkt.conversation_id,
|
||||||
|
topic = pkt.subtopic,
|
||||||
|
pkt = pkt.payload.as_slice(),
|
||||||
|
"Draining"
|
||||||
|
);
|
||||||
|
|
||||||
let hash = Blake2b::<U6>::new()
|
let hash = Blake2b::<U6>::new()
|
||||||
.chain_update("delivery_addr|")
|
.chain_update("delivery_addr|")
|
||||||
.chain_update(&pkt.conversation_id)
|
.chain_update(&pkt.conversation_id)
|
||||||
@ -150,6 +163,7 @@ impl de_mls::ds::DeliveryService for BufferDs {
|
|||||||
type Error = DeliveryServiceError;
|
type Error = DeliveryServiceError;
|
||||||
|
|
||||||
fn publish(&mut self, packet: de_mls::ds::OutboundPacket) -> Result<(), Self::Error> {
|
fn publish(&mut self, packet: de_mls::ds::OutboundPacket) -> Result<(), Self::Error> {
|
||||||
|
info!(topic = packet.subtopic, "Publish");
|
||||||
self.queue.push(packet);
|
self.queue.push(packet);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@ -337,6 +351,7 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn wakeup(&mut self, ctx: &mut ServiceContext<S>) -> Result<(), ChatError> {
|
fn wakeup(&mut self, ctx: &mut ServiceContext<S>) -> Result<(), ChatError> {
|
||||||
|
info!(app = self.app_id(), "Wakeup");
|
||||||
let tick = run_async!(self.user.poll_session(&self.convo_id).await.unwrap());
|
let tick = run_async!(self.user.poll_session(&self.convo_id).await.unwrap());
|
||||||
let events = self
|
let events = self
|
||||||
.user
|
.user
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user