Skip to content
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

Better handling for marking DM'd invoices as paid #1089

Merged
merged 2 commits into from
Mar 26, 2024
Merged

Conversation

benthecarman
Copy link
Collaborator

Closes #1087

First commit is pretty straight forward, makes it so in our startup check instead of removing only expired invoices, we also check for paid ones

Second commit I don't love but not sure the best way to do this otherwise. This attempts to remove any payment we make from our pending nwc. I am not really sure a better way to handle this besides making the frontend instead call approve_invoice instead of pay_invoice for invoices in our dm's but that doesn't seem the best either.

@TonyGiorgio
Copy link
Contributor

making the frontend instead call approve_invoice instead of pay_invoice

Actually, that doesn't seem that paid of an idea. This works too I guess but this is going to be more of a performance requirement on every sent payment. There's going to be more sent payments than invoices in DMs.

@benthecarman
Copy link
Collaborator Author

Actually, that doesn't seem that paid of an idea

that's what i tried to do first, the problem is that the front end takes you to the send screen so we'd need to keep the state of which function to call throughout. Also we don't have a guarantee that it is actually in the pending nwc list, the user could reject it in the list but then in DMs they could pay it.

@TonyGiorgio
Copy link
Contributor

Yeah this is probably fine at least for now. Odds are there's not really any pending requests anyways for very long.

@benthecarman benthecarman merged commit 4c81907 into master Mar 26, 2024
9 checks passed
@benthecarman benthecarman deleted the rm-pending-nwc branch March 26, 2024 23:22
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.

Invoices paid in DMs won't clear the "Pending (1)" notification.
2 participants