piggz / harbour-amazfish

Amazfit Bip support for SailfishOS
GNU General Public License v3.0
103 stars 51 forks source link

PairPage doesn't show same devices when reopened #315

Open jmlich opened 9 months ago

jmlich commented 9 months ago

I was examining the behavior of the PairPage, and it seems a little confusing to me. I must admit the used mechanism is hard for me to understand.

https://github.com/piggz/harbour-amazfish/blob/712118e9eef2c60b0868484d924a948b5402aeeb/ui/qml/pages/PairPage.qml#L75-L93

It seems to try to filter devices by name based on the selection on the previous page. However, it seems that this mechanism isn't used when the model is initialized (when I click back and reopen the page). My first impression was that the device list is not properly refreshed during scanning.

jmlich commented 8 months ago

Long story short: the filtering is applied just "items.onChanged", but not onCompleted, which may look strange. It may happen that list is loaded and doesn't change for few seconds (if you are in between of model update interval).

I am actually not sure which event (onCompleted?) should be used.