Skip to content

feat(LSPS1): Add waiting screen for channels paid from external wallets#3985

Draft
shubhamkmr04 wants to merge 2 commits into
ZeusLN:masterfrom
shubhamkmr04:feat/lsps1-external-payment-confirmation
Draft

feat(LSPS1): Add waiting screen for channels paid from external wallets#3985
shubhamkmr04 wants to merge 2 commits into
ZeusLN:masterfrom
shubhamkmr04:feat/lsps1-external-payment-confirmation

Conversation

@shubhamkmr04
Copy link
Copy Markdown
Contributor

Description

Relates to issue: #3952

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

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

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

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

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 introduces the LSPS1PaymentAwait component to poll and display the status of LSPS1 orders, along with necessary navigation updates and localization strings. Feedback includes removing a debug console.log statement, addressing redundant or potentially incorrect back-button handling logic, and adding error handling for asynchronous operations involving Storage.setItem and handleAnything.

Comment thread views/LSPS1/index.tsx Outdated
Comment on lines +139 to +141
private handleBackPress = (): boolean => {
return false;
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The handleBackPress listener currently returns false, which means it doesn't intercept the back button event and allows the default behavior to proceed. If the intention was to allow the default back navigation, this listener and its registration in componentDidMount and componentWillUnmount are redundant and should be removed. If the intention was to prevent navigation during the polling process, it should return true.

const oldOrder = JSON.parse(responseArray[index]);
oldOrder.order = order;
responseArray[index] = JSON.stringify(oldOrder);
Storage.setItem(LSPS_ORDERS_KEY, responseArray);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Storage.setItem is an asynchronous operation. It should be handled with a .catch() block or await to ensure errors are caught and the operation completes as expected.

                    Storage.setItem(LSPS_ORDERS_KEY, responseArray).catch((error) => {
                        console.error('LSPS1PaymentAwait: error saving order', error);
                    });

Comment on lines +237 to +239
handleAnything(invoice).then(([route, props]) => {
navigation.navigate(route, props);
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

handleAnything is an asynchronous function that can throw errors. It is recommended to add a .catch() block to handle potential failures gracefully.

        handleAnything(invoice).then(([route, props]) => {
            navigation.navigate(route, props);
        }).catch((error) => {
            console.error('LSPS1PaymentAwait: error handling invoice', error);
        });

@shubhamkmr04 shubhamkmr04 force-pushed the feat/lsps1-external-payment-confirmation branch 3 times, most recently from 98f401a to d793733 Compare April 21, 2026 10:25
@shubhamkmr04 shubhamkmr04 force-pushed the feat/lsps1-external-payment-confirmation branch from d793733 to b6b9e23 Compare April 21, 2026 13:17
@shubhamkmr04 shubhamkmr04 reopened this Apr 21, 2026
@shubhamkmr04 shubhamkmr04 force-pushed the feat/lsps1-external-payment-confirmation branch from 8dfe573 to 5c788f5 Compare April 21, 2026 13:26
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