Skip to content

Conversation

@Klakurka
Copy link
Member

@Klakurka Klakurka commented Sep 11, 2025

Depends on

Description

Prod fix for including outputAddresses in payment trigger messages.

Test plan

  1. Create a payment trigger post data request w/ <outputAddresses> set.
  2. Make a payment to see if it works.

Summary by CodeRabbit

  • New Features
    • Trigger/webhook POST payloads now include output addresses alongside input addresses, providing richer transaction context for reconciliation and analytics.
    • Backwards compatible: existing integrations continue to work without changes. No action required unless you want to consume the new field.

@Klakurka Klakurka added this to the Phase 3 milestone Sep 11, 2025
@Klakurka Klakurka self-assigned this Sep 11, 2025
@Klakurka Klakurka added the bug Something isn't working label Sep 11, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 11, 2025

Walkthrough

Adds outputAddresses to the trigger POST payload constructed in buildPostParams within services/triggerService.ts, alongside existing inputAddresses. No public/exported signatures changed.

Changes

Cohort / File(s) Summary
Trigger post payload
services/triggerService.ts
Extends PostDataParameters construction to include outputAddresses: tx.outputAddresses when sending trigger POST requests; no interface or signature changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor EventSource as Event Source
  participant TriggerService as triggerService
  participant TriggerURL as External Trigger URL

  EventSource->>TriggerService: onTxEvent(tx)
  TriggerService->>TriggerService: buildPostParams(tx)\n- inputAddresses\n- outputAddresses (new)
  TriggerService->>TriggerURL: HTTP POST postDataParameters
  alt 2xx
    TriggerURL-->>TriggerService: Ack
  else Error
    TriggerURL-->>TriggerService: Error response
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

enhancement (UI/UX/feature)

Pre-merge checks (2 passed, 1 warning)

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.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
Title Check ✅ Passed The title succinctly summarizes the primary change — fixing payment triggers when outputAddresses are present. It directly aligns with the code change (adding outputAddresses to the trigger POST payload) and is specific enough for a reviewer to understand the main intent. The title is concise and free of extraneous information.
Description Check ✅ Passed The PR description includes a dependency, a brief Description explaining the production fix, and a concrete Test plan with two actionable steps, covering the template's primary sections. It omits the top-level "Related to #" line from the template and could benefit from more detail about expected results and the target environment (staging vs production) for testing. Overall the description is mostly complete and sufficient for review with minor additions requested.

Poem

A bunny taps the POSTing drum,
Now outputs join where inputs come.
Hop-hop, the payload’s neatly dressed,
Extra addresses in the quest.
Ears up—triggers fire on cue,
Carrots count from one to two. 🥕✨

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


📜 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 98f8adc and 503f3a7.

📒 Files selected for processing (1)
  • services/triggerService.ts (1 hunks)
🔇 Additional comments (1)
services/triggerService.ts (1)

308-310: Add outputAddresses to POST params — verified & LGTM

SimplifiedTransaction defines outputAddresses as Array<{address: string; amount: Prisma.Decimal}> (ws-service/types.ts) and parseTriggerPostData replaces '' using JSON.stringify(postDataParameters.outputAddresses, ... ) (utils/validators.ts); unit tests cover the expected serialization/shape — no further changes needed.

✨ 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/payment-triggers-with-outputaddr

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

@Klakurka
Copy link
Member Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 11, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Klakurka
Copy link
Member Author

Confimed working in prod.

@chedieck chedieck merged commit 58e182b into feat/async-and-improved-initialization Sep 12, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants