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

Lost data in sync when API is configured in TZ different than UTC #31

Open
gvillafanetapia opened this issue Jan 15, 2021 · 0 comments
Open

Comments

@gvillafanetapia
Copy link

gvillafanetapia commented Jan 15, 2021

When calling Mambu API filter creationDate AFTER is truncated and stripped off timezone information;

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

  1. Configure Mambu API to a timezone different than UTC
  2. Setup a bookmark within the timezone difference (e.g.: if the timezone is GMT-3 set the bookmark between 00 and 03 UTC)
  3. Call tap-mambu
  4. Validate missing transactions
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

No branches or pull requests

1 participant