feat(matrix): log message-handler firing + wake delivery to localise the no-wake bug
This commit is contained in:
parent
7529c67f6b
commit
b7529f2e00
1 changed files with 18 additions and 1 deletions
|
|
@ -34,12 +34,29 @@ pub fn install_message_handler(client: &Client, hyperhive_socket: PathBuf) {
|
||||||
let socket = socket.clone();
|
let socket = socket.clone();
|
||||||
let own_user = own_user.clone();
|
let own_user = own_user.clone();
|
||||||
async move {
|
async move {
|
||||||
|
// INFO so the live host journal shows the handler actually
|
||||||
|
// firing on an incoming event — the daemon previously logged
|
||||||
|
// only handler *install*, which made a non-firing dispatch
|
||||||
|
// path (sync not advancing → events deduped, or a room-state
|
||||||
|
// mismatch) impossible to distinguish from a delivery failure.
|
||||||
|
tracing::info!(
|
||||||
|
room = %room.room_id(),
|
||||||
|
sender = %event.sender,
|
||||||
|
state = ?room.state(),
|
||||||
|
"matrix: message handler fired"
|
||||||
|
);
|
||||||
if room.state() != RoomState::Joined {
|
if room.state() != RoomState::Joined {
|
||||||
|
tracing::info!(
|
||||||
|
room = %room.room_id(),
|
||||||
|
state = ?room.state(),
|
||||||
|
"matrix: skipping message — room not in Joined state"
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Self-event filter so the agent's own outgoing messages
|
// Self-event filter so the agent's own outgoing messages
|
||||||
// don't wake it. matches forge_notify's self-skip pattern.
|
// don't wake it. matches forge_notify's self-skip pattern.
|
||||||
if own_user.as_ref().is_some_and(|u| u == &event.sender) {
|
if own_user.as_ref().is_some_and(|u| u == &event.sender) {
|
||||||
|
tracing::debug!(sender = %event.sender, "matrix: skipping self-event");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Build a wake body that covers all rooms with unread
|
// Build a wake body that covers all rooms with unread
|
||||||
|
|
@ -68,7 +85,7 @@ pub fn install_message_handler(client: &Client, hyperhive_socket: PathBuf) {
|
||||||
if let Err(e) = wake::send_wake(&socket, &body).await {
|
if let Err(e) = wake::send_wake(&socket, &body).await {
|
||||||
tracing::warn!(error = %e, "failed to deliver matrix wake to hyperhive");
|
tracing::warn!(error = %e, "failed to deliver matrix wake to hyperhive");
|
||||||
} else {
|
} else {
|
||||||
tracing::debug!(room = %room.room_id(), "matrix wake delivered");
|
tracing::info!(room = %room.room_id(), "matrix wake delivered");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue