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

Handle YNAB failure + Duplicate transaction case #19

Closed
scottrobertson opened this issue May 1, 2017 · 3 comments
Closed

Handle YNAB failure + Duplicate transaction case #19

scottrobertson opened this issue May 1, 2017 · 3 comments
Labels

Comments

@scottrobertson
Copy link
Collaborator

The following just happened:

  • Webhook came in
  • YNAB raised Rate Limit error*
  • Monzo sent the webhook again
  • We returned "duplicate"

This happened because we pushed the transaction into be_transactions, but then didnt end up syncing it with YNAB. Not sure what the best course of action is here.

*it's low at the moment as they have a huge bug in the mobile apps that were killing the DB.

@rienafairefr
Copy link

Is this something that I can fix on my side ? I guess YNAB sent us a request_throttled error, then the library retries after the delay that the server sent, more or less indefinitely

@scottrobertson
Copy link
Collaborator Author

scottrobertson commented May 4, 2017

@rienafairefr i am not sure. Based on my understanding, the following would happen right now:

  • We receive the webhook
  • Adds to be_transactions
  • Sync fails
  • Webhook retires
  • Duplicate

But then:

  • Another transaction comes in
  • Sync happens
  • Both transactions are synced

The issue arises when a deployment happens between the 2 transactions as the be_transactions will be reset, and transaction 1 will be lost.

I feel like the cleanest solution for our side is to remove the transaction from be_transactions when the sync fails, allowing the webhook retries to handle it.

@rossdargan
Copy link
Collaborator

It looks like this is not the same issue as #26, however the failure results in the duplicate.

I think after a failure we need to kill the local copy of the ynab service somehow... if we could somehow re-load it in the background we would be golden...

What does heroku do if the app service dies? If it restarts it then maybe it's best to let the app die in the short term?!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants