Closed metabubble closed 1 year ago
Thanks for your report! Bunq2ynab uses the "created" date from the API:
"Payment": {
"id": xxx,
"created": "2020-07-22 13:11:00.693934",
"updated": "2020-07-22 13:11:00.693934",
"monetary_account_id": xxx,
"amount": {
"currency": "EUR",
"value": "0.95"
},
It only looks at the date part ("2020-07-22" in the example.) I assumed both the Bunq and YNAB API use UTC.
I'm surprised it doesn't show up in YNAB at all. Perhaps we can find a hint in the logging. What do you see when you run the script with the "-v" parameter? The output might be large.
I can run it with the -v parameter manually next time I am up past midnight to test. However, I think we are already on it:
| 2023-08-08T00:57:20.497+02:00 | 2023-08-07 22:57:20,497 | INFO | sync.py:176 | synchronize_account | Reading bunq payments from 2023-08-08...
at localtime 2023-08-08T00:57:20.497+02:00, which is UTC 2023-08-07 22:57:20,497 the script was reading transactions from 2023-08-08
Let me know if testing is still necessary or if that is the hint we need.
Looks like both APIs use ISO 8601 and UTC: https://api.ynab.com/#best-practices https://beta.doc.bunq.com/basics/api-conventions#time-formats
Interesting. Bunq2ynab uses the date of the last transaction from YNAB as the first date to read from BUNQ. So I wonder what transactions the YNAB API returns to make the script use an UTC date in the future.
What's your last YNAB transaction? Do you use their scheduled transaction feature?
Yes, that's it. I scheduled a transaction for today in YNAB, and it was executed at around 1am.
Did some testing, it's not easy to reproduce. A scheduled transaction remains uncleared until it's matched, and when bunq2ynab calculates the start date, it ignores uncleared transactions. Do you remember any manual actions, like marking the transaction as cleared?
Yes, I did. It was doing multiple card top ups from different cards after midnight and the first one worked, the subsequent ones didn't.
The reason why I recorded the transactions first was, because they were transfers and not transactions. I guess that is an ultra edgecase that might even be just irgnored. Most bunqers should be where this is only a problem in a 2 hour window when more than one transactions occur in that window and they are cleared manually
On the other hand, deducting the timezone offset from the current datetime to adjust the date by one day (if needed) for reading bunq transactions might be a universal fix, that can catch other timezone related issues.
Ah that clears it up. This can probably be fixed by ensuring the start date is not in the future. I'll try to write that in.
Should be resolved by https://github.com/wesselt/bunq2ynab/commit/96e1d41e469623f85d12ba8462270cd808046caf
Hi,
is there a potential problem with timezones? I have noticed, that transactions that happen right after midnight, they show up
So what I can see here after midnight is, that it is reading transactions from "today", but the api exposes these transactions with yesterday's date, at least according to moneymoney.
P.S: I am running on AWS as lambda function