Skip to content

fix: include created_at on AddInvoice SmallOrder#739

Merged
grunch merged 3 commits into
mainfrom
fix/add-invoice-payload-created-at
May 16, 2026
Merged

fix: include created_at on AddInvoice SmallOrder#739
grunch merged 3 commits into
mainfrom
fix/add-invoice-payload-created-at

Conversation

@arkanoider
Copy link
Copy Markdown
Collaborator

@arkanoider arkanoider commented May 14, 2026

Summary

  • Set SmallOrder.created_at from order.created_at in set_waiting_invoice_status when sending Action::AddInvoice to the buyer, matching the payload shape used in flow::hold_invoice_paid so clients (e.g. Mostrix) can show order creation time after a take-sell flow without an invoice in the take message.

Summary by CodeRabbit

  • Bug Fixes

    • Buyer invoice notifications now include the order creation timestamp.
  • Tests

    • Test helpers updated to include the anti-abuse bond field for environment-variable override scenarios.

Review Change Stack

arkanoider and others added 2 commits May 14, 2026 22:42
Populate order creation time when asking the buyer for an invoice so
clients can display listing metadata consistently with hold-invoice flow.

Also update config test Settings helper for anti_abuse_bond field.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ad653676-153f-4b45-9f85-f5ceb62cee5c

📥 Commits

Reviewing files that changed from the base of the PR and between d6d89f7 and 820c304.

📒 Files selected for processing (1)
  • src/config/util.rs

Walkthrough

Adds the order creation timestamp to the buyer invoice notification payload and updates a test Settings fixture to include anti_abuse_bond: None.

Changes

Invoice payload and test fixture

Layer / File(s) Summary
Invoice payload includes creation timestamp
src/util.rs
set_waiting_invoice_status now sets the SmallOrder field to Some(order.created_at) when enqueuing the AddInvoice payload.
Test Settings fixture
src/config/util.rs
make_settings test helper now explicitly sets anti_abuse_bond: None in the Settings struct literal.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • MostroP2P/mostro#524: Also modifies set_waiting_invoice_status payload construction in src/util.rs to fix buyer amount calculation using saturating_sub.
  • MostroP2P/mostro#464: Adjusts which active_order/SmallOrder data is packaged and returned in invoice-related responses.

Suggested reviewers

  • grunch
  • Catrya

Poem

🐰 A tiny timestamp hops inside,
The invoice keeps when orders arrived,
A test gets tidy, fields set right,
Small changes make the garden bright. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding the created_at field to the SmallOrder payload in the AddInvoice action, which matches the primary objective of the pull request.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/add-invoice-payload-created-at

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.

@arkanoider arkanoider requested review from Catrya and grunch May 14, 2026 20:57
@grunch
Copy link
Copy Markdown
Member

grunch commented May 16, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 16, 2026

✅ 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.

Copy link
Copy Markdown
Member

@grunch grunch left a comment

Choose a reason for hiding this comment

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

LGTM

@grunch grunch merged commit 89c4eec into main May 16, 2026
8 checks passed
@grunch grunch deleted the fix/add-invoice-payload-created-at branch May 16, 2026 17:28
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.

2 participants