closeio / closeio/sync-engine

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

Open
#775 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
30
Forks
13
Avg merge
1d 2h
Merged PRs (30d)
8

Description

See also https://github.com/closeio/sync-engine/pull/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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with inbox/models/account.py at the referenced account._sync_status handling, then review the related CRM parsing and pull request 771. Verify the migration sequence: CRM accepts ISO datetimes, sync-engine writes them, existing rows are converted, json_util.py is removed, and CRM no longer accepts $date.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend, database
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.