Skip to content

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

@gvillafanetapia

Description

@gvillafanetapia

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions