Skip to content

Clarify hold invoice cancellation errors#4085

Open
newmattock wants to merge 1 commit into
ZeusLN:masterfrom
newmattock:fix-hold-invoice-cancel-error
Open

Clarify hold invoice cancellation errors#4085
newmattock wants to merge 1 commit into
ZeusLN:masterfrom
newmattock:fix-hold-invoice-cancel-error

Conversation

@newmattock
Copy link
Copy Markdown

@newmattock newmattock commented May 12, 2026

Description

Relates to issue: #2001

This PR makes the LND "Payment details incorrect" response clearer for users, especially when a hold invoice has been canceled. It maps the raw LND REST error text to the existing incorrect-payment-details locale key, updates the English copy to explain that the invoice may have been rejected, canceled, or expired, and keeps the Keysend-specific hint appended through the locale-key path.

This pull request is categorized as a:

  • New feature
  • Bug fix
  • Code refactor
  • Configuration change
  • Locales update
  • Quality assurance
  • Other

Checklist

  • I've run yarn run tsc and made sure my code compiles correctly
  • I've run yarn run lint and made sure my code didn't contain any problematic patterns
  • I've run yarn run prettier and made sure my code is formatted correctly
  • I've run yarn run test and made sure all of the tests pass

Validation run for this focused patch:

  • ./node_modules/.bin/prettier --check utils/ErrorUtils.ts utils/ErrorUtils.test.ts locales/en.json
  • ./node_modules/.bin/eslint utils/ErrorUtils.ts utils/ErrorUtils.test.ts
  • ./node_modules/.bin/jest utils/ErrorUtils.test.ts --runInBand
  • ./node_modules/.bin/tsc --noEmit --pretty false

Current GitHub PR checks are passing on the PR:

  • lint: passed
  • prettier: passed
  • test: passed
  • tsc: passed

Maintainer-requested first-time-contributor media is still not attached. This patch changes utility error mapping and locale text, with behavior covered by utils/ErrorUtils.test.ts; no synthetic screenshot or recording has been attached.

Testing

If you modified or added a utility file, did you add new unit tests?

  • No, I'm a fool
  • Yes
  • N/A

I have tested this PR on the following platforms (please specify OS version and phone model/VM):

  • Android
  • iOS

Not device-tested. This is a utility/error-message mapping change covered by utils/ErrorUtils.test.ts.

I have tested this PR with the following types of nodes (please specify node version and API version where appropriate):

On-device

  • LDK Node
  • Embedded LND

Remote

  • LND (REST)
  • LND (Lightning Node Connect)
  • Core Lightning (CLNRest)
  • Nostr Wallet Connect
  • LndHub

The new test covers the raw LND REST text: Payment details incorrect (unknown hash, invalid amt or invalid final cltv delta).

Locales

  • I've added new locale text that requires translations
  • I'm aware that new translations should be made on the ZEUS Transfix page and not directly to this repo

Third Party Dependencies and Packages

  • Contributors will need to run yarn after this PR is merged in
  • 3rd party dependencies have been modified:
    • verify that package.json and yarn.lock have been properly updated
    • verify that dependencies are installed for both iOS and Android platforms

Other:

  • Changes were made that require an update to the README
  • Changes were made that require an update to onboarding

Fixes #2001

Copy link
Copy Markdown
Contributor

@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 updates the error message for incorrect payment details in the English locale to be more descriptive and adds a mapping for raw LND error strings to ensure they are translated correctly. It also includes updated unit tests for these changes. A review comment suggests updating the logic that appends Keysend-specific hints to use the locale key instead of the enum string, ensuring that raw LND errors also receive the appropriate context-specific messaging.

Comment thread utils/ErrorUtils.ts
@newmattock newmattock force-pushed the fix-hold-invoice-cancel-error branch from 9fdb2cb to 09802e1 Compare May 12, 2026 06:24
@shubhamkmr04
Copy link
Copy Markdown
Contributor

Hi @newmattock, please make sure to include the full PR template when opening pull requests. You can find more details in our contribution guidelines

@kaloudis
Copy link
Copy Markdown
Contributor

Per the Contribution Guidelines, first time contributors are required to include screenshots or screen recordings of their changes.

@newmattock
Copy link
Copy Markdown
Author

Thanks, acknowledged. I do not currently have real device or simulator media for this LND error mapping path, so I will not attach synthetic evidence. The PR body lists the unit/static validation, including the raw LND REST error test; I will add real UI evidence if/when I can reproduce the canceled hold-invoice path on a device or simulator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vague error when HOLD invoice canceled

3 participants