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

Get rid of $date syntax in JSON documents in account._sync_status #775

Open
squeaky-pl opened this issue Jun 3, 2024 · 1 comment
Open

Comments

@squeaky-pl
Copy link
Contributor

squeaky-pl commented Jun 3, 2024

See also #771

This syntax is not human readable as an artifact of reliance pymongo's extended json capabilities. It's only used in this single column. The tables in all the clusters are very small (~80MB) so I don't see a problem with rewriting this data.

Steps:

  1. Adapt CRM side code that parses $date, to also accept normal ISO serialization of datetimes, like we do everywhere else. We currently ingest this data to CRM through sync-engine's API to calculate account status and delays.
  2. Ship a change to sync-engine that uses ISO datetimes instead of $date
  3. Run a script to convert all the data in sync-engine
  4. Remove inbox/sqlalchemy_ext/json_util.py and just use stdlib's json module
  5. Drop support for $date from CRM side

sync-engine/inbox/models/account.py

@squeaky-pl squeaky-pl changed the title Get rid of $date syntax in JSON documents Get rid of $date syntax in JSON documents in account._sync_status Jun 3, 2024
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

2 participants
@squeaky-pl and others