Skip to content

fix: republished sell order uses taker's language instead of seller's (#820) - #822

Closed
franko-c wants to merge 1 commit into
lnp2pBot:mainfrom
franko-c:fix/republish-sellorder-uses-taker-i18n
Closed

fix: republished sell order uses taker's language instead of seller's (#820)#822
franko-c wants to merge 1 commit into
lnp2pBot:mainfrom
franko-c:fix/republish-sellorder-uses-taker-i18n

Conversation

@franko-c

@franko-c franko-c commented May 30, 2026

Copy link
Copy Markdown

ran into #820 — when a buyer's invoice times out and the sell order gets republished in cancelAddInvoice, publishSellOrderMessage is handed i18nCtx, which is the canceling taker's context. so the republished order comes back in the taker's language instead of the seller's.

the seller-cancel branch at bot/commands.ts:591 already does this right with i18nCtxSeller — this just mirrors that for the buyer-cancel/expiry side. sellerUser is already in scope from the lookup above, so it's a small change.

typechecks clean with tsc --noEmit. happy to adjust if you'd rather thread the context through differently.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed language localization issue when re-publishing sell orders during invoice cancellation, ensuring sellers receive notifications in their configured language.

Review Change Stack

…r-cancel

When a buyer's invoice times out and the sell order is republished in
cancelAddInvoice, publishSellOrderMessage was passed i18nCtx (the canceling
taker's context), so the republished order rendered in the taker's language.
The seller-cancel path already uses i18nCtxSeller; this mirrors it. Fixes lnp2pBot#820.
@coderabbitai

coderabbitai Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e34a57c9-82a3-4d69-aafc-bf8caafeb030

📥 Commits

Reviewing files that changed from the base of the PR and between e838c79 and 509ffc1.

📒 Files selected for processing (1)
  • bot/commands.ts

Walkthrough

The PR updates the cancelAddInvoice function to use a seller-specific i18n context when re-publishing sell orders during the WAITING_BUYER_INVOICE cancellation path, replacing the previous use of the canceling user's i18n context.

Changes

Seller i18n Context for Order Re-publication

Layer / File(s) Summary
Seller i18n context for sell order re-publication
bot/commands.ts
During sell-order re-publication in cancelAddInvoice, the code fetches a seller-specific i18n context (i18nCtxSeller) and supplies it to publishSellOrderMessage instead of using the canceling user's i18n context (i18nCtx).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • lnp2pBot/bot#763: Both PRs modify bot/commands.ts cancellation messaging—specifically cancelAddInvoice now uses a seller-specific i18nCtxSeller (not the canceling user's i18nCtx) when re-publishing sell orders.

Suggested reviewers

  • grunch
  • mostronatorcoder

Poem

🐰 A context switch for seller's tongue,
When orders are reprised and sung,
The message now speaks true and fair,
In seller's words, with proper care! 📬

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the specific bug being fixed: republished sell orders using the wrong language context (taker's instead of seller's). It directly corresponds to the main change in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 unit tests (beta)
  • Create PR with unit tests

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.

@Luquitasjeffrey

Copy link
Copy Markdown
Collaborator

This pr is a duplicate of #821

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