avniproject / integration-service

Service for integration Avni with other systems
GNU Affero General Public License v3.0
0 stars 2 forks source link

Goonj Integration skips entities during sync #113

Closed himeshr closed 10 months ago

himeshr commented 10 months ago

This issue was discovered during debug of this ticket https://avni.freshdesk.com/a/tickets/3396

Root cause

In Goonj integration, we add an offset of 1 second to the last synced entity's "Last modified at" dateTime value, in-order to avoid repeated sync of the same entity from Avni to Salesforce. But this resulted in us skipping over sync of entities that are within that time-gap of 1 second.

Fix

In Goonj integration, we'll now add an offset of 1 Milli-second(Not 1 second) to the last synced entity's "Last modified at" dateTime value, to avoid skipping over entities. As the precision in the APIs is at every millisecond.

"audit": {
                "Created at": "2024-01-06T10:46:40.873Z",
                "Last modified at": "2024-01-06T11:00:12.267Z",
                "Created by": "user@goonj",
                "Last modified by": "user@goonj"
            },

Post deploy actions

vinayvenu commented 10 months ago

@himeshr Reg: ErrorRecordWorker.java - In our API, we fetch only everything after the cutoff time, so it doesn't make sense to add any time to it. This affects other integrations. Same comment on SubjectWorker.java.

Essentially, I think it might be more accurate to remove the offset completely.

himeshr commented 10 months ago

@vinayvenu removed the offsets..