-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(background)!: better payment confirmation & message #694
Merged
Merged
Changes from 14 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
c9ddb61
fix(background)!: better payment confirmation message
sidvishnoi 05efcb0
wait before first attempt; rename function
sidvishnoi 28d4b03
Merge branch 'main' into payment-confirmation
sidvishnoi 244ab38
make PaymentSession.pay always return OutgoingPayment; retry/throw ot…
sidvishnoi 2148d3f
try different signature: get last outgoingPayment regardless of error
sidvishnoi a0ee3c6
Merge branch 'main' into payment-confirmation
sidvishnoi 30eb935
Merge branch 'main' into payment-confirmation
sidvishnoi 465ba9c
use async generator in polling; handle more errors; more abstraction
sidvishnoi 951dc74
Merge branch 'main' into payment-confirmation
sidvishnoi 52abeaa
require only outgoingPaymentId in polling
sidvishnoi c96aa90
nit
sidvishnoi 48cf703
nit: style/import
sidvishnoi 6f93b1c
ui & message improvements
sidvishnoi d4e89fd
use same error message for `OutgoingPayment.failed = true`
sidvishnoi d57f918
Merge branch 'main' into payment-confirmation
sidvishnoi 4b13c73
reduce polling initial delay from 2.5s to 1.5s
sidvishnoi a0768ee
walletAddress check
sidvishnoi e11cf13
fix typo in error key name
sidvishnoi 3df3acd
comment on null assertion
sidvishnoi cba0301
use payStatus full/partial instead of success/warn; also in bg
sidvishnoi d1e3681
Merge branch 'main' into payment-confirmation
sidvishnoi bca0dbf
Merge branch 'main' into payment-confirmation
sidvishnoi 6560b41
update comment for isMissingGrantPermissionsError
sidvishnoi 387cc08
handle case isMissingGrantPermissionsError is actually isTokenInactiv…
sidvishnoi 715746e
update success/failure states; add partial status; update msgs
sidvishnoi 2979f04
update success message to remove URL
sidvishnoi 34ac427
Merge branch 'main' into payment-confirmation
sidvishnoi b626ad3
Merge branch 'main' into payment-confirmation
sidvishnoi 3021b41
use opacity animation on message, slide is distracting
sidvishnoi 3c8434c
fix disabled styles
sidvishnoi d2ae2ce
Merge branch 'main' into payment-confirmation
sidvishnoi 6efb7ba
update _locales key description
sidvishnoi 9032cc4
handle insufficient grant by checking token's access values
sidvishnoi fb115d1
add todo comment
sidvishnoi 0678549
Merge branch 'main' into payment-confirmation
sidvishnoi 5347047
Merge branch 'main' into payment-confirmation
sidvishnoi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failed
should happen whenoutgoing_payment.failed = false
andoutgoing_payment.sent_amount === 0
, since the OP can fail during sending and only send a partial amount.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be clear,
OutgoingPayment.failed = true
andOutgoingPayment.sent_amount > 0
is possible?We want to treat any partial amount to be treated as success here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
We cannot treat a sent partial amount as an error (
failed = true && sent_amount = 0
), since an amount was actually sent. We can usepayStatus.type = 'partial'
for this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed cases with @raducristianpopa on Slack. We need to handle these cases:
@RabebOthmani How to best show this to user? For added context, after the payment, we've to repeatedly check payment status (polling). Right now, we check for up to 8 seconds only. The payment might be in any of above 5 states.
Also, note that, we'll be showing user a spinner for those 8s. Might be better to show "verifying payment status" message while we are in verify stage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8s is a long time for just a spinner. My unsolicited opinion is that we should show some kind of messaging for sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per Slack: