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

Messages from Fitbit to Companion are Lost while Syncing

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.

Best Answer
0 Votes
2 REPLIES 2

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

Best Answer
0 Votes

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. 

Best Answer
0 Votes