Skip to content

🦺 server: acknowledge panda dispute events#755

Merged
cruzdanilo merged 1 commit intomainfrom
panda
Feb 10, 2026
Merged

🦺 server: acknowledge panda dispute events#755
cruzdanilo merged 1 commit intomainfrom
panda

Conversation

@cruzdanilo
Copy link
Member

@cruzdanilo cruzdanilo commented Feb 10, 2026


Open with Devin

Summary by CodeRabbit

  • New Features

    • Added support for receiving and acknowledging dispute events from Panda (handler now immediately returns OK for dispute payloads).
  • Tests

    • Added test coverage asserting dispute webhook events are accepted and return { code: "ok" }.
  • Chores

    • Added a changeset entry with a patch bump and release note.

@changeset-bot
Copy link

changeset-bot bot commented Feb 10, 2026

🦋 Changeset detected

Latest commit: 520573b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@exactly/server Patch

Not sure what this means? Click here to learn what changesets are.

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

@coderabbitai
Copy link

coderabbitai bot commented Feb 10, 2026

Walkthrough

Adds recognition for Panda "dispute" webhook events: expands the Payload validation to include a resource: "dispute" variant and short-circuits the POST handler to immediately respond { code: "ok" } for dispute events. Includes a test asserting the behavior.

Changes

Cohort / File(s) Summary
Changeset
.changeset/neat-eel-walk.md
Adds a patch changeset documenting acknowledgement of Panda dispute events.
Webhook Payload Handling & Tests
server/hooks/panda.ts, server/test/hooks/panda.test.ts
Extends Payload union with resource: "dispute" (fields: action, body: { id }, id) and adds an early return in the POST handler to respond { code: "ok" } for dispute events; adds test verifying 200 { code: "ok" } response.

Sequence Diagram(s)

sequenceDiagram
  participant Panda as Panda (Webhook Sender)
  participant Server as Server Hook (server/hooks/panda.ts)
  participant Processor as Internal Processor

  Panda->>Server: POST /webhook (resource: "dispute", action, body, id)
  Server->>Server: validate Payload (includes dispute variant)
  alt resource == "dispute"
    Server-->>Panda: 200 { code: "ok" }
  else
    Server->>Processor: forward validated payload for processing
    Processor-->>Server: ack
    Server-->>Panda: 200 { code: "ok" }
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • nfmelendez
🚥 Pre-merge checks | ✅ 2
✅ 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 'acknowledge panda dispute events' directly relates to the main change: adding support for dispute webhook events in the panda hook handler with corresponding test coverage.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch panda

No actionable comments were generated in the recent review. 🎉


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.

@gemini-code-assist
Copy link

Summary of Changes

Hello @cruzdanilo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces the ability for the server to acknowledge dispute events originating from Panda. It includes modifications to the payload validation schema and adds a handler to immediately acknowledge dispute events with a 200 OK response. A new test case was also added to ensure the correct behavior of the new dispute event handling logic.

Highlights

  • Panda Dispute Events: This PR acknowledges Panda dispute events by adding a new variant to the Payload type and a corresponding handler that returns a 200 OK response.
  • Test Coverage: Included a new test case to verify the correct handling of dispute events, ensuring the endpoint returns the expected 200 OK response.
Changelog
  • server/hooks/panda.ts
    • Added a new variant to the Payload type to include dispute events.
    • Implemented a handler to immediately acknowledge dispute events with a 200 OK response.
  • server/test/hooks/panda.test.ts
    • Added a new test case to verify the correct handling of dispute events.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@sentry
Copy link

sentry bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.13%. Comparing base (53f75e7) to head (520573b).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #755      +/-   ##
==========================================
+ Coverage   67.29%   68.13%   +0.83%     
==========================================
  Files         206      206              
  Lines        7005     7082      +77     
  Branches     2189     2239      +50     
==========================================
+ Hits         4714     4825     +111     
+ Misses       2099     2063      -36     
- Partials      192      194       +2     
Flag Coverage Δ
e2e 66.30% <0.00%> (-0.51%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for acknowledging dispute events from Panda. The implementation is straightforward, adding a schema for the dispute event and returning an 'ok' response. My suggestions to make the schema for the dispute event body more specific and robust, aligning it with other event types for better consistency and validation, and to add a test case to verify this new validation logic, remain valid and are included.

Copy link

@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: 1

🤖 Fix all issues with AI agents
In `@server/hooks/panda.ts`:
- Line 215: Before the early return for dispute events, add minimal Sentry
observability: call Sentry.setTag("panda.resource", "dispute") and set context
with Sentry.setContext("panda", await c.req.json()) (and optionally
Sentry.setUser if user info is available) immediately before the line checking
payload.resource === "dispute" so the handler still returns c.json({ code: "ok"
}) but leaves a Sentry trace; reference the existing payload.resource check and
the request context (c.req.json()) in server/hooks/panda.ts when making these
additions.

@cruzdanilo cruzdanilo merged commit 520573b into main Feb 10, 2026
15 checks passed
@cruzdanilo cruzdanilo deleted the panda branch February 10, 2026 13:31
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.

1 participant

Comments