Skip to content

Conversation

@nischitpra
Copy link
Contributor

@nischitpra nischitpra commented Aug 19, 2025

PR-Codex overview

This PR introduces an optional webhook_id property to the TestWebhookPayload interface and updates the testWebhook function call to include this new property.

Detailed summary

  • Added an optional webhook_id property to the TestWebhookPayload interface in webhooks.ts.
  • Updated the testWebhook function call in useTestWebhook.ts to include webhook_id when calling the function.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • Bug Fixes
    • Test Webhook requests now include the webhook ID when available, ensuring the test targets the correct webhook and improving reliability.
    • Payload now consistently includes the webhook identifier field (may be empty if not provided), with no other behavioral changes.

@nischitpra nischitpra requested review from a team as code owners August 19, 2025 22:14
@changeset-bot
Copy link

changeset-bot bot commented Aug 19, 2025

⚠️ No Changeset found

Latest commit: b9e63ff

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Aug 19, 2025

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

Project Deployment Preview Comments Updated (UTC)
thirdweb-www Ready Ready Preview Comment Aug 19, 2025 10:43pm
4 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
docs-v2 Skipped Skipped Aug 19, 2025 10:43pm
nebula Skipped Skipped Aug 19, 2025 10:43pm
thirdweb_playground Skipped Skipped Aug 19, 2025 10:43pm
wallet-ui Skipped Skipped Aug 19, 2025 10:43pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 19, 2025

Walkthrough

Added optional webhook_id to TestWebhookPayload in the insight webhooks API and included this field when invoking testWebhook from the useTestWebhook hook. No changes to request path, response handling, or control flow.

Changes

Cohort / File(s) Summary
API types
apps/dashboard/src/@/api/insight/webhooks.ts
Introduced optional field webhook_id?: string to internal TestWebhookPayload interface; no exported API signature changes.
Hook integration
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/hooks/useTestWebhook.ts
Updated payload sent to testWebhook to include webhook_id: id; other logic unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 71854ca and b9e63ff.

📒 Files selected for processing (2)
  • apps/dashboard/src/@/api/insight/webhooks.ts (1 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/hooks/useTestWebhook.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/hooks/useTestWebhook.ts
  • apps/dashboard/src/@/api/insight/webhooks.ts
⏰ 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). (8)
  • GitHub Check: Size
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Lint Packages
  • GitHub Check: Build Packages
  • GitHub Check: Unit Tests
  • GitHub Check: Analyze (javascript)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch np/test_webhook

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@graphite-app
Copy link
Contributor

graphite-app bot commented Aug 19, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Aug 19, 2025
@nischitpra nischitpra added the merge-queue Adds the pull request to Graphite's merge queue. label Aug 19, 2025 — with Graphite App
Copy link
Contributor Author

nischitpra commented Aug 19, 2025

Merge activity

@codecov
Copy link

codecov bot commented Aug 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.54%. Comparing base (7705304) to head (b9e63ff).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7884   +/-   ##
=======================================
  Coverage   56.54%   56.54%           
=======================================
  Files         904      904           
  Lines       58592    58592           
  Branches     4143     4143           
=======================================
  Hits        33131    33131           
  Misses      25355    25355           
  Partials      106      106           
Flag Coverage Δ
packages 56.54% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 19, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 64.06 KB (0%) 1.3 s (0%) 291 ms (+135.81% 🔺) 1.6 s
thirdweb (cjs) 357.05 KB (0%) 7.2 s (0%) 1.1 s (+12.76% 🔺) 8.2 s
thirdweb (minimal + tree-shaking) 5.73 KB (0%) 115 ms (0%) 93 ms (+1354.08% 🔺) 208 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 76 ms (+2767.55% 🔺) 87 ms
thirdweb/react (minimal + tree-shaking) 19.15 KB (0%) 383 ms (0%) 118 ms (+527.05% 🔺) 500 ms

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/hooks/useTestWebhook.ts (1)

1-1: Mark this hooks module as a Client Module

This file uses React hooks (useState) and toasts; it should start with the client directive to satisfy Next’s client boundary rules.

Apply:

+"use client";
 import { useState } from "react";
🧹 Nitpick comments (3)
apps/dashboard/src/@/api/insight/webhooks.ts (1)

60-64: Model the payload as an exclusive union (id XOR url) to prevent ambiguous requests

If the API expects exactly one of webhook_id or webhook_url, enforce that at the type level. This also matches the guidelines to prefer type aliases for shapes like this.

If the backend allows both fields simultaneously, ignore this. Otherwise, consider:

-interface TestWebhookPayload {
-  webhook_id?: string;
-  webhook_url: string;
-  type?: "event" | "transaction";
-}
+type TestWebhookPayload =
+  { type?: "event" | "transaction" } & (
+    | { webhook_id: string; webhook_url?: never }
+    | { webhook_url: string; webhook_id?: never }
+  );

Optionally document precedence (if both are sent) in a short JSDoc so callers don’t guess behavior.

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/hooks/useTestWebhook.ts (2)

44-46: Avoid sending both webhook_id and webhook_url; build the payload conditionally

Prevents ambiguous server behavior and avoids sending empty IDs. Also trims whitespace-only IDs.

If the API truly supports both fields at once, feel free to skip. Otherwise:

-      const result = await testWebhook(
-        { type, webhook_url: webhookUrl, webhook_id: id },
-        clientId,
-      );
+      const payload =
+        typeof id === "string" && id.trim().length > 0
+          ? { type, webhook_id: id.trim() }
+          : { type, webhook_url: webhookUrl };
+      const result = await testWebhook(payload, clientId);

If we adopt the exclusive-union type proposed in webhooks.ts, this also gives compile-time safety here.


71-75: Surface server error details in the toast to aid debugging

If the API returns an error string, include it for better UX.

-        toast.error("Failed to send test event", {
-          description:
-            "The server reported a failure in sending the test event.",
-        });
+        toast.error("Failed to send test event", {
+          description:
+            result.error ?? "The server reported a failure in sending the test event.",
+        });
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 7705304 and 71854ca.

📒 Files selected for processing (2)
  • apps/dashboard/src/@/api/insight/webhooks.ts (1 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/hooks/useTestWebhook.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (CLAUDE.md)

**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from @/types or local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial, Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose

Files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/hooks/useTestWebhook.ts
  • apps/dashboard/src/@/api/insight/webhooks.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit Inference Engine (CLAUDE.md)

Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)

Files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/hooks/useTestWebhook.ts
  • apps/dashboard/src/@/api/insight/webhooks.ts
apps/{dashboard,playground-web}/**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (CLAUDE.md)

apps/{dashboard,playground-web}/**/*.{ts,tsx}: Import UI primitives from @/components/ui/* (Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
Use NavLink for internal navigation with automatic active states in dashboard and playground apps
Use Tailwind CSS only – no inline styles or CSS modules
Use cn() from @/lib/utils for conditional class logic
Use design system tokens (e.g., bg-card, border-border, text-muted-foreground)
Server Components (Node edge): Start files with import "server-only";
Client Components (browser): Begin files with 'use client';
Always call getAuthToken() to retrieve JWT from cookies on server side
Use Authorization: Bearer header – never embed tokens in URLs
Return typed results (e.g., Project[], User[]) – avoid any
Wrap client-side data fetching calls in React Query (@tanstack/react-query)
Use descriptive, stable queryKeys for React Query cache hits
Configure staleTime/cacheTime in React Query based on freshness (default ≥ 60s)
Keep tokens secret via internal API routes or server actions
Never import posthog-js in server components

Files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/hooks/useTestWebhook.ts
  • apps/dashboard/src/@/api/insight/webhooks.ts
⏰ 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). (3)
  • GitHub Check: Lint Packages
  • GitHub Check: Size
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
apps/dashboard/src/@/api/insight/webhooks.ts (1)

60-64: LGTM: optional webhook_id on TestWebhookPayload is non‑breaking

Adding webhook_id?: string is backward-compatible and aligns with the new usage. No runtime or control-flow risk here.

<!-- start pr-codex -->

## PR-Codex overview
This PR introduces a new optional property `webhook_id` to the `TestWebhookPayload` interface and updates the call to `testWebhook` to include this new property.

### Detailed summary
- Added an optional property `webhook_id` to the `TestWebhookPayload` interface in `webhooks.ts`.
- Updated the `testWebhook` function call in `useTestWebhook.ts` to include `webhook_id` when invoking the function.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **Bug Fixes**
  * Test Webhook requests now include the specific webhook ID when available, ensuring the test targets the correct webhook and improving reliability.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@vercel vercel bot temporarily deployed to Preview – docs-v2 August 19, 2025 22:35 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui August 19, 2025 22:35 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula August 19, 2025 22:35 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground August 19, 2025 22:35 Inactive
@graphite-app graphite-app bot merged commit b9e63ff into main Aug 19, 2025
25 checks passed
@graphite-app graphite-app bot deleted the np/test_webhook branch August 19, 2025 22:44
@graphite-app graphite-app bot removed the merge-queue Adds the pull request to Graphite's merge queue. label Aug 19, 2025
@vercel vercel bot temporarily deployed to Production – wallet-ui August 19, 2025 22:44 Inactive
@vercel vercel bot temporarily deployed to Production – docs-v2 August 19, 2025 22:44 Inactive
@vercel vercel bot temporarily deployed to Production – nebula August 19, 2025 22:44 Inactive
@vercel vercel bot temporarily deployed to Production – thirdweb_playground August 19, 2025 22:44 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Dashboard Involves changes to the Dashboard.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants