Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(notification): redact payloads from error logs (#5425)

teo3a36dbbfab06
diff --git a/crates/notification/src/inbound/notification_events_listener.rs b/crates/notification/src/inbound/notification_events_listener.rs
index 1d1d73a322..2c4c302ff2 100644
--- a/crates/notification/src/inbound/notification_events_listener.rs
+++ b/crates/notification/src/inbound/notification_events_listener.rs
@@ -43,7 +43,7 @@ where
let event = match serde_json::from_str::<NotificationDatabaseEvent>(payload) {
Ok(event) => event,
Err(err) => {
- tracing::warn!(error = ?err, payload, "failed to deserialize notification database event");
+ tracing::warn!(error = ?err, payload_length = payload.len(), "failed to deserialize notification database event");
return;
}
};
diff --git a/crates/notification/src/outbound/digest_batcher.rs b/crates/notification/src/outbound/digest_batcher.rs
index f1dc96cedb..e086892964 100644
--- a/crates/notification/src/outbound/digest_batcher.rs
+++ b/crates/notification/src/outbound/digest_batcher.rs
@@ -176,7 +176,7 @@ impl DigestBatcher for RedisDigestBatcher {
.into_iter()
.filter_map(|s| {
serde_json::from_str::<UserNotificationRow<serde_json::Value>>(&s)
- .inspect_err(|e| tracing::error!(error=?e, json=%s, "failed to deserialize digest notification"))
+ .inspect_err(|e| tracing::error!(error=?e, payload_length=s.len(), "failed to deserialize digest notification"))
.ok()
.map(|n| n.into_tagged())
})
diff --git a/crates/notification/src/outbound/queue.rs b/crates/notification/src/outbound/queue.rs
index 31de749ec0..b6074efb31 100644
--- a/crates/notification/src/outbound/queue.rs
+++ b/crates/notification/src/outbound/queue.rs
@@ -76,7 +76,7 @@ impl NotificationQueue for SqsQueue {
.filter_map(|msg| {
let body_str = msg.body?;
let body = serde_json::from_str(&body_str)
- .inspect_err(|e| tracing::error!(error=?e, body=%body_str, "failed to deserialize queue message"))
+ .inspect_err(|e| tracing::error!(error=?e, payload_length=body_str.len(), "failed to deserialize queue message"))
.ok()?;
let receipt_handle = msg.receipt_handle?;
Some(RawQueueMessage {
@@ -116,7 +116,7 @@ impl NotificationIngressQueue for SqsQueue {
.filter_map(|msg| {
let body_str = msg.body?;
let body = serde_json::from_str(&body_str)
- .inspect_err(|e| tracing::error!(error=?e, body=%body_str, "failed to deserialize ingress queue message"))
+ .inspect_err(|e| tracing::error!(error=?e, payload_length=body_str.len(), "failed to deserialize ingress queue message"))
.ok()?;
let receipt_handle = msg.receipt_handle?;
Some(RawIngressQueueMessage {