precisely / curious2

0 stars 0 forks source link

Oura data polling and getDataDefault method implementation #932

Closed sagrawal31 closed 8 years ago

sagrawal31 commented 8 years ago

Screenshots

Before Polling

Last polled updated from the migration

1-last-polled-from-migration

Previous entries before polling

2-entry-18th-before-polling 3-entry-19th-before-polling

Missed entry notification for a day

4-missed-entry-notification-for-20th

After polling

Last polled updated after pollAll method

5-last-polled-updated-after-polling

Previous entries got unset and new entries created (no duplicacy)

6-no-duplicate-entry-after-polling-18th-march 7-no-duplicate-entry-after-polling-19th-march

Entry created for missed notification after polling

8-entry-created-for-missed-notification-after-polling-20th-march

Entry for a day already created from polling then the notification for the same day is processed (no duplicacy)

9-no-duplicate-after-duplicate-notification

sagrawal31 commented 8 years ago

Implementation Notes

  1. The signature of abstract method has now been changed to also accept the end date to make the data service method more robust and generic
  2. getDataDefault method & other data specific methods (getDataSleep, getDataActivity etc) for Oura will now accept start date & end date to import data for the given date range
  3. A migration will set lastPolled to all OAuthAccount for Oura to now - 4 days so that we can start polling the data for past 4 days after these changes goes live to make sure we don't miss any data due to the certificate issues.
  4. Set name for Oura import has now been updated since data for any day can be imported at any day.
  5. Backward support for old set name has been added to gurantee that no duplicate entries getting created due to change in the set name or importing same day data multiple times (see screenshots and test cases for the same)
syntheticzero commented 8 years ago

Rebased and merged into master.