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.

chore: add debug logs to stripe webhook (#2441)

dev-rb32e62bec523e
diff --git a/rust/cloud-storage/authentication_service/src/api/webhooks/user/stripe_webhook.rs b/rust/cloud-storage/authentication_service/src/api/webhooks/user/stripe_webhook.rs
index 717855f693..247820e485 100644
--- a/rust/cloud-storage/authentication_service/src/api/webhooks/user/stripe_webhook.rs
+++ b/rust/cloud-storage/authentication_service/src/api/webhooks/user/stripe_webhook.rs
@@ -139,13 +139,25 @@ async fn handle_customer_subscription_event(
// Skip processing if the subscription is still incomplete
if current_status == "incomplete" {
- tracing::debug!("skipping incomplete subscription");
+ tracing::info!(
+ current_status = current_status,
+ "skipping incomplete subscription"
+ );
return Ok(());
}
// For subscription.updated events, check if we're transitioning from incomplete
// to active/trialing. If so, this is effectively a "new" subscription activation.
let previous_status = extract_previous_status(&previous_attributes);
+
+ tracing::info!(
+ event_type = ?event_type,
+ current_status = current_status,
+ previous_status = ?previous_status,
+ previous_attributes_raw = ?previous_attributes,
+ "subscription event status details"
+ );
+
let is_transition_from_incomplete =
matches!(event_type, EventType::CustomerSubscriptionUpdated)
&& previous_status.as_deref() == Some("incomplete")
@@ -157,6 +169,13 @@ async fn handle_customer_subscription_event(
current_status = current_status,
"subscription transitioned from incomplete to active state"
);
+ } else if matches!(event_type, EventType::CustomerSubscriptionUpdated) {
+ tracing::info!(
+ previous_status = ?previous_status,
+ current_status = current_status,
+ is_transition_from_incomplete = is_transition_from_incomplete,
+ "subscription update did not qualify as incomplete transition"
+ );
}
// Stripe CustomerId and subscription CustomerId are not the same type...