11-07-2020 06:51
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

11-07-2020 06:51
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I've noticed that all attempts of a Fitbit app to talk to its companion fail when sync is pending. From user's point of view Fitbit app is not functional during this time. Two questions about it:
1. Is there any way for Fitbit device to know that sync is pending and tell a user about it?
2. Can Fitbit Dev take a look and investigate if this annoying problem can be solved? It really impacts user experience, and it impacts it badly.
The second option would be the best of course.

11-16-2020 04:28
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


11-16-2020 04:28
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Can you elaborate a little more.
When you say sync is pending, do you mean sync is in progress?
Are you getting an error event, or are the messages queued?
iOS, Android or both? Which version.
Which Fitbit device and firmware version?
Thanks

11-16-2020 22:53 - edited 11-19-2020 12:09
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

11-16-2020 22:53 - edited 11-19-2020 12:09
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Yes, sync is in progress. The problem is on both Android and iOS platforms. I know, posting a message to the queue is a recommended way, but I need an answer from companion quick since a user is waiting, so I'm doing something like this, which works in the most cases, but not always, e.g. it surely doesn't work when sync is in progress.
function sleep(ms) {
g.d("SLEEP: " + ms);
return new Promise((resolve,reject) => {setTimeout(()=>{g.d("END SLEEP");resolve(1)}, ms)});
}
export function msg(msg, nc=true) {
let r = doMsg(msg);
if (r) {
return;
}
sleep(g.MSGINT).then(()=>doMsg(msg)).
then((r)=>{
if (!r) {
sleep(g.MSGINT).then(()=>doMsg(msg)).then((r)=>{
if (!r) {
sleep(g.MSGINT).then(()=>doMsg(msg)).then((r)=>{
if (!r) {
sleep(g.MSGINT).then(()=>doMsg(msg)).then((r)=>{
if (!r) {
sleep(g.MSGINT).then(()=>doMsg(msg)).then((r)=>{
if (!r) {
sleep(g.MSGINT).then(()=>doMsg(msg)).then((r)=>{
if (!r) {
sleep(g.MSGINT).then(()=>doMsg(msg, nc));
}});
}});
}});
}});
}});
}});
}
function doMsg (m, la=false) {
g.d("DMSG " + m + " " + messaging.peerSocket.readyState)
if (messaging.peerSocket.readyState === messaging.peerSocket.OPEN) {
messaging.peerSocket.send(m);
return true;
}
if (la)
noConn(NOCONN, "Turn BT and Location On. Make sure sync's not running. Restart app");
return false;
}
In regard of physical Fitbit devices and firmware: Ionic and Versa with the latest firmware upgrade. I always upgrade to the latest when it's available.
Any suggestions are appreciated. Thanks.

