question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

subscribeToInvoice() call forget invoices after nodejs restarts

See original GitHub issue

If nodejs restarts at the time an invoice is held

invoice with hash: a76fa7f91fffca163edbb1373c0358b065dc216397f02d51761f10f588e3db19 is being held!

Node loses tracking of this event and when releasing, if the invoice is paid, but the subscribeToInvoice does not follow the normal workflow, the status is not changed to PAID_HOLD_INVOICE and as a consequence the buyer is not paid.

We need to think a way of avoid this situation, one is never restart nodejs if at least one invoice is held, but we need to have a procedure to follow if the server crashes.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
csralvallcommented, Jan 19, 2022

I’ve just tested it. It works perfectly. For the sake of completeness I updated my test cases results:

  • Order = BUY.

    • Situation: The server restarts after invoice is paid and before the command /fiatsent is executed.
    • Result:
      1. The bot keeps waiting for the /fiatsent command.
      2. /fiatsent is executed.
      3. /release is executed.
      4. The operation is finished successfully.
  • Order = BUY.

    • Situation: The server restarts after invoice is paid and before the command /release is executed.
    • Result:
      1. The bot keeps waiting for the /release command.
      2. /release is executed.
      3. The operation is finished successfully.

I will open a PR with the changes.

1reaction
csralvallcommented, Jan 15, 2022

Good! I will start testing by my own.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node.js: Automatic Syncing of iOS Subscription Status
Automatic iOS Subscription renewal and cancellation in Node.js. Managing subscriptions for iOS apps is critical infrastructure to ensure users have access ...
Read more >
How to work with Node.js App - Hosting - Namecheap.com
PLEASE NOTE: During the restart, it won't be possible to perform any actions with the app. To edit the application, open cPanel >>...
Read more >
Node JS auto restart all forever JS process when server goes ...
A (NodeJS) server should not stop for no reason. Most of the time, it's because of a 500 Error that have not been...
Read more >
Retrieve an upcoming invoice – Node - Stripe API reference
At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including...
Read more >
sahat/hackathon-starter: A boilerplate for Node.js ... - GitHub
A while later, you might have an initial project up on GitHub, ... It watches for any changes in your node.js app and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found