Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Duplicate Sleep Subscription Notifications

ANSWERED

Over the last month or so noticing that we are receiving duplicate sleep notifications within  seconds of each other. Example of a couple of notifications received this morning:

 

{
"Type": "fb",
"Payload": "[{\"collectionType\":\"sleep\",\"date\":\"2019-01-13\",\"ownerId\":\"###\",\"ownerType\":\"user\",\"subscriptionId\":\"#####\"},{\"collectionType\":\"sleep\",\"date\":\"2019-01-14\",\"ownerId\":\"###\",\"ownerType\":\"user\",\"subscriptionId\":\"#####"}]",
"NotificationReceived": "2019-01-14T15:50:23.4480476Z"
}

{
"Type": "fb",
"Payload": "[{\"collectionType\":\"sleep\",\"date\":\"2019-01-14\",\"ownerId\":\"###\",\"ownerType\":\"user\",\"subscriptionId\":\"#####\"},{\"collectionType\":\"sleep\",\"date\":\"2019-01-13\",\"ownerId\":\"###\",\"ownerType\":\"user\",\"subscriptionId\":\"####\"}]",
"NotificationReceived": "2019-01-14T15:50:11.1282931Z"
}

 

Is this an issue with a device reporting sleep multiple times or something going on with our API integration?

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Hi @TJISMH

 

Are you getting the duplicate notifications for all users or just certain users?

Do you know if there have been any changes to your subscription code, the scopes the user authorized or the device the user owns?

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google

View best answer in original post

Best Answer
0 Votes
9 REPLIES 9

Hi @TJISMH

 

Are you getting the duplicate notifications for all users or just certain users?

Do you know if there have been any changes to your subscription code, the scopes the user authorized or the device the user owns?

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes

Every sleep notification that was received today came as a pair. One of those devices is my personal device which has not changed in some time.

I will monitor over the next couple of days to see if there are any that are not duplicated.

Best Answer
0 Votes

Over the last couple of days every sleep notification we are receiving for our user based has a duplicate notification received with a couple of seconds or less.

Best Answer
0 Votes

Hi @TJISMH

 

Thank you for reporting this problem.  I've been able to reproduce it and plan to submit a defect to engineering.   

 

Gordon

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes

Hi, I was directed to this post since I have been encountering the same behaviours. This occurs on activities collection subscriptions also. Are there any updates from engineering as to:

 

A) Why does this happen? 

B) Is there likely to be a solution implemented?

    - If so on what timescale?

C) Are there any suggested actions to mitigate against this - since duplicate notifications are currently duplicating other processes within our application which are spawned from the notification requests ?

 

Thanks for you time. 

Best Answer
0 Votes

Hi @Joel_R 

 

The bug for duplicate notifications for sleep has not been resolved, yet.  For activities, are you also collecting heart rate data?  Heart rate is part of the activities endpoint.  So, you might be seeing a notification for an activity and another notification for the heart rate data.

 

Gordon

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes

Hi Gordon thanks for your response.

 

I can look into the details you mentioned re: activities and clarify our configuration on this. --> (I will do this at a time I can manage around my other work commitments). For the short term I thought it may be useful to extend this thread re: sleep notification duplication. Since there is a case I'd like to raise. 

 

The cases our as follows, ( I repeat the existing case for completeness - I understand this is already logged). 

 

In each case a collection specific subscriber is used. (sleep collection only)

 

1. Singular Sleep Notification. 

- User Device: charge_2

- Sync: Android Fitbit Application

 

User syncs one day of sleep. With all prior sleep data previously synced. 

 

Outcome: Duplicate singular messages. (Exert of the subscriber logs provided by fitbit. With the corresponding notification object)

issue_133.jpg

 

2. Multi-Day Sync

- User Device: charge_2

- Sync: IOS Application

 

Outcome: Numerous notifications of varying length and content. Along side a singular Notification #7. which contains the payload in its entirety.

 

Note in this instance there is not the simple duplication as highlighted in 1. (i.e. two notificaitons with the full payload - 5 messages), but instead a (seemingly arbitrary) flury of partial payload notifications. Delivered within a narrow window. 

 

celery_tasks.jpg

 

I would not be surprised if these linked. 

 

Would you be able to confirm this behaviour or point out if this is desired ?  Due to the time needed to backlog multi day sleep notifications I only have one example. 

 

In addition....

To better enable us to troubleshoot our logs it would be fruitful to receive answers to the below questions:

1. What timestamp is used in the subscriber logs? - When the notification is sent form fitbit//when the response is received from registered third-party application? 

 

I look forward to receiving your response. 

 

Best Answer
0 Votes

Hi @Joel_R 

 

Are you able to reproduce this behavior by manually entering sleep data?   

 

Thanks!

Gordon

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes

Hi @Gordon-C any update on this issue?

 

I'm seeing this with sleep data also. I'm getting duplicate notifications after syncing my sleep data from my fitbit (charge 4) and also when manually entering sleep data via the Fitbit app (on iOS).

 

Interestingly the auto sync (from my fitbit device) seems to cause duplicates within milliseconds of each other, but when I manually enter sleep data the duplicates seem to be within seconds of each other.

 

Thanks

Paul

 

 

Best Answer