Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@devkiran
Copy link
Collaborator

@devkiran devkiran commented Sep 19, 2025

Summary by CodeRabbit

  • Bug Fixes

    • Standardized webhook payloads for lead and sale events by setting metadata to null across Stripe and Shopify integrations.
    • Removed previously included invoice/order metadata from sale event payloads to ensure consistent structure.
  • Chores

    • Aligned event payload formatting across related webhook flows without altering control flow or public interfaces.

@vercel
Copy link
Contributor

vercel bot commented Sep 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
dub Ready Ready Preview Sep 19, 2025 0:44am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 19, 2025

Walkthrough

Adds an explicit metadata: null field to transformed lead and sale event payloads across Stripe webhook handlers and Shopify integrations. In invoice-paid and Shopify sale, this replaces previously populated metadata (e.g., invoice/order JSON) with null. No function signatures, control flow, or error handling changed.

Changes

Cohort / File(s) Summary
Stripe webhooks: lead/sale payloads
apps/web/app/(ee)/api/stripe/integration/webhook/checkout-session-completed.ts, apps/web/app/(ee)/api/stripe/integration/webhook/invoice-paid.ts, apps/web/app/(ee)/api/stripe/integration/webhook/utils.ts
Add metadata: null to objects passed to transformLeadEventData/transformSaleEventData; in invoice-paid, overrides prior invoice metadata with null.
Shopify integrations: lead/sale payloads
apps/web/lib/integrations/shopify/create-lead.ts, apps/web/lib/integrations/shopify/create-sale.ts
Add metadata: null to transformed lead/sale payloads; in sale, overrides prior order-based metadata with null.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • steven-tey
  • TWilson023

Poem

A hop, a skip, a null I bring,
To payloads where the bytes all sing.
No invoice tales, no order lore—
Just empty pockets at the door.
Thump-thump! says QA, light and dull,
The carrots pass with metadata null. 🥕🐇

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "Fix the metadata property in webhook payload" accurately and concisely summarizes the primary change in the diff—making the webhook payloads' metadata explicit (set to null) across lead/sale flows for Stripe and Shopify—so it clearly reflects the main intent without unnecessary detail.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-webhook

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7486deb and ecf8d19.

📒 Files selected for processing (5)
  • apps/web/app/(ee)/api/stripe/integration/webhook/checkout-session-completed.ts (2 hunks)
  • apps/web/app/(ee)/api/stripe/integration/webhook/invoice-paid.ts (1 hunks)
  • apps/web/app/(ee)/api/stripe/integration/webhook/utils.ts (1 hunks)
  • apps/web/lib/integrations/shopify/create-lead.ts (1 hunks)
  • apps/web/lib/integrations/shopify/create-sale.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (6)
apps/web/lib/integrations/shopify/create-lead.ts (1)

105-105: LGTM! Consistent metadata standardization.

The explicit metadata: null addition aligns with the PR's objective to standardize webhook payloads across all lead/sale events.

apps/web/lib/integrations/shopify/create-sale.ts (1)

136-136: LGTM! Webhook payload consistency maintained.

The change properly overrides saleData.metadata (which contains the Shopify order JSON) with null for the webhook payload, ensuring consistent metadata handling across all sale events.

apps/web/app/(ee)/api/stripe/integration/webhook/utils.ts (1)

130-130: LGTM! Consistent lead webhook payload format.

The addition of metadata: null maintains consistency with the other lead event webhook payloads in this PR.

apps/web/app/(ee)/api/stripe/integration/webhook/checkout-session-completed.ts (2)

413-413: LGTM! Lead webhook payload standardized.

The explicit metadata: null addition ensures consistent webhook payload format for lead events.


427-427: LGTM! Sale webhook payload standardized.

The change properly overrides saleData.metadata (which contains the Stripe charge JSON) with null for the webhook payload, maintaining consistency across all sale events.

apps/web/app/(ee)/api/stripe/integration/webhook/invoice-paid.ts (1)

245-245: LGTM! Invoice webhook payload consistency maintained.

The change correctly overrides saleData.metadata (which contains the Stripe invoice JSON) with null for the webhook payload, completing the consistent metadata handling pattern across all webhook events in this PR.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@steven-tey steven-tey merged commit dd67ace into main Sep 19, 2025
9 of 10 checks passed
@steven-tey steven-tey deleted the fix-webhook branch September 19, 2025 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants