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

Companion data out of order

I am not sure if anyone can answer this or if this if for @JonFitbit. I have noticed that data is not loaded in order when transferred from the companion. Here is what I mea:

 

I have 8 textInputs set up in settings and with each onchange, it send the data over to the watch which is displayed on the screen in label 1-8.

 

When watching the console.log with (`App received: ${JSON.stringify(evt.data.newValue)}`);  at startup, I notice that the data does load in order:
"App recieved: label 1 data"

label 2 data

etc. in order all the way to lablel 8 data.

 

Instead you see it come done out of orded like

label 1 data

label 3 data

label 6 data 

label 2 data

 

Can anyone explain why it does this? I didnt really care until I needed to start setting the scrollView height dependent upon if the lable has data or not. The issue I am seeing is that label 2 data is always last and sets the scrollview to only see up to that point, even if label 3-8 has data.

Best Answer
0 Votes
1 REPLY 1

I would guess that maybe a settings change event gets added to the top of the stack, so previously queued ones potentially arrive out of order.

 

Just send the key with your value, then you can be sure which is which.

 

// companion
settingsStorage.onchange = evt => { console.log(`${evt.key} :: ${evt.newValue}`); };

 

Best Answer
0 Votes