-
Notifications
You must be signed in to change notification settings - Fork 25
Lost data in sync when API is configured in TZ different than UTC #31
Description
When calling Mambu API filter creationDate AFTER is truncated and stripped off timezone information;
Line 363 in 7651a31
| deposit_transactions_dt_str = transform_datetime(deposit_transactions_dttm_str)[:10] |
Therefore, if Mambu API is configured in a timezone different than UTC, data is lost.
Is there a reason why this is truncated? I tested with a fork and the Mambu API accepts the full datetime string, TZ aware.
Expected behaviour
If current bookmark is;
{
"bookmarks": {
"deposit_transactions": "2021-01-15T01:50:26.000000Z"
}
}
Request to Mambu should be;
INFO URL for deposit_transactions (POST, v2): https://****.mambu.com/api/deposits/transactions:search?offset=0&limit=500&detailsLevel=FULL
INFO body = {'sortingCriteria': {'field': 'creationDate', 'order': 'ASC'}, 'filterCriteria': [{'field': 'creationDate', 'operator': 'AFTER', 'value': '2021-01-15T01:50:26Z'}]}
So I get transactions from 2021-01-15T01:50:26.000000Z regardless of the configured timezone in Mambu.
Actual behaviour
If current bookmark is;
{
"bookmarks": {
"deposit_transactions": "2021-01-15T01:50:26.000000Z"
}
}
Request to Mambu is;
INFO URL for deposit_transactions (POST, v2): https://****.mambu.com/api/deposits/transactions:search?offset=0&limit=500&detailsLevel=FULL
INFO body = {'sortingCriteria': {'field': 'creationDate', 'order': 'ASC'}, 'filterCriteria': [{'field': 'creationDate', 'operator': 'AFTER', 'value': '2021-01-15'}]}
So Mambu API interprets it with configured timezone, therefore if I'm expecting to get everything from 2021-01-15T01:50:26.000000Z but mambu returns only AFTER 2021-01-15 GMT-3 (which is equivalent to 2021-01-15T03:00:00Z), I miss all transactions in between 2021-01-15T01:50:26.000000Z and 2021-01-15T03:00:00Z
Steps to reproduce
- Configure Mambu API to a timezone different than UTC
- Setup a bookmark within the timezone difference (e.g.: if the timezone is GMT-3 set the bookmark between 00 and 03 UTC)
- Call tap-mambu
- Validate missing transactions