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

Change duplicate webhook notification behavior. #39

Merged
merged 1 commit into from
Sep 23, 2023

Conversation

caarmen
Copy link
Owner

@caarmen caarmen commented Sep 23, 2023

For both withings and fitbit: mark a notification as processed only if we successfully fetched data.

Sometimes when we fetch data, it's not ready yet. Example fetch response after receiving a sleep notification:

{
  "meta": {
    "retryDuration":3000,
    "state":"pending"
  },
  "sleep":[],
  "summary": {
    "totalMinutesAsleep":0,
    "totalSleepRecords":0,
    "totalTimeInBed":0
  }
}

It contains no sleep data.
A duplicate notification was received a few seconds after this one, but we ignored it. Maybe we should have tried the fetch.

For both withings and fitbit: mark a notification as processed only if we successfully fetched data.

Sometimes when we fetch data, it's not ready yet. Example fetch response after receiving a sleep notification:
```json
{
  "meta": {
    "retryDuration":3000,
    "state":"pending"
  },
  "sleep":[],
  "summary": {
    "totalMinutesAsleep":0,
    "totalSleepRecords":0,
    "totalTimeInBed":0
  }
}
```
It contains no sleep data.
A duplicate notification was received a few seconds after this one, but we ignored it. Maybe we should have tried the fetch.
@caarmen caarmen requested a review from BoD September 23, 2023 09:47
@caarmen caarmen merged commit c238f55 into main Sep 23, 2023
@caarmen caarmen deleted the change-duplicate-notification-behavior branch September 23, 2023 09:50
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

Successfully merging this pull request may close these issues.

1 participant