trupici / G-Watch-Wear

G-Watch App for Wear OS Samsung watch models
Apache License 2.0
39 stars 10 forks source link

Widget does loose all historic information if you open the app #27

Closed nigzak closed 9 months ago

nigzak commented 9 months ago

++ UPDATE ++ This ticket left is about widget looses all information, tought in the beginning it was because of accu save mechanism which is wrong. Scroll down to see relevant comments and ignore comments with hints "not relevant"

// NOT RELEVANT since last update to 0.9.7 the app disappeared on my S9 STOCK from the menu to put to the exceptions of accu sleep mode ("do not stop this app")

If I open the accu exception menu (accu => do not put app in standby) the G-Watch-Wear app is not there anymore after the apdate, if I click on "add" it is not listed anymore to put on the exception list.

As result it is almost un-usable on the S9 because I have my S9 on accu safe mode because of the crappy libe-app which drains my accu if I do not have it in this mode.

Can you please check this? It is now not really good ... if I pick the phone I have almost always no data (empty chart) and no value ...

Info menu => console also shows that if I open the menu it says started a few seconds ago ... seems there is some issue that it does not appear in the selection to put it in the accu save exception list ..?

S9 STOCK OneUI 2.5 Android 10

nigzak commented 9 months ago

++ UPDATE: IGNORE THIS COMMENT, THERE IS NO RELEVANT INFO INSIDE ++

Found the workaround via google to re-enable the app in the "do not put in standby" list

go to app settings of G-Wear open accu section of app and change from "not optimized" to "optimized" close all open menus open settings => accu => not standby apps => add => it is appearing again and can be added now

don't know why this happened (?), still looking if this fixes it

EDIT: no it does NOT, if I re-open the app it asks "end optimize". If I confirm this it disappears again from this list. Is this an expected thing? Read in the past that some apps have troubles with samsung (and other producer of phones) and some "sharp accu save mechanism" that they stop all apps if they are not on this exception list - even if they are on the "do not optimize" list. Seems this might be the reason it is bad working for me (?) If I remember right this news was about it MIGHT be fixed with some later android version (11+ ?) where it should (or might ) not be allowed from manufactures to override the accu save mechanism in that bad ways ...

I now will try to "deny" the dialog of G-Watch to let the app stay in the "do not put in standby mode" and observe it

trupici commented 9 months ago

yes, if you set it on optimised it will indeed appear in the never sleeping apps. if you allow 'as not optimized/unrestricted' it wont appear, because it is implicit. The app is asking you for not optimized permission at the beginning and set it as unrestricted if you allow. This is not what you are looking for.

In the previous version there was a notification service with its permanent bg notification keeping the app alive. However, in 0.9.7 which was updated to use Android 14 SDK this is no more 'allowed' according to A14 guidelines (app won't be accepted by play store). So, I removed the notification service from the app and the app is forcing to sleep by OS. Now I am working on the win-win solution - you can have notification which user can disallow and the app will be resistant to forcible sleep.

Btw, gwatch app is always woken up when the new bg value is available - either by broadcast form CGM app or internal alarms used to poll bg data from data source server or widget timer (to redraw the bg graph). The only issue now is that I had the notification service stateful and all its data is reset on every process start.

nigzak commented 9 months ago

Thanks for the fast update. I tought it might be because the SDK update :)

I can tell you on my S9: if I put it to desk, wait 5-10m and open it - it always has now a blank chart with one dot ... it is not working now anymore (widget is at least broken) ... Currently I have no watch connected but because the app always in the console says "started [few seconds back]" I think it is not working even now with the watch ...

I will start now the watch and update here

Test which I will do: connect watch, validate that one entry has been sent to watch close all open apps lock handy and wait to see if watch gets still updated

nigzak commented 9 months ago

observation: that what you said

Precondition: no watch connected, let some data be on the chart (2+ datapoints) Open the console, click a view times on "connect watch" close all apps => sometimes only one datapoint ("latest one") is still there if this did not triggered the data loss reopen the console and try again

or Open App / close app / Open app

I need max. to do it 2 times and the chart is blank again (=only one datapoint visible) (probably that what you said with "data is reset on every process start")

Workaround until fix for all: DO NOT OPEN THE APP (not as app, not clicking on the widget ... as soon as you open it it looses the widget data)

nigzak commented 9 months ago

... and new thing happens: on some point the app (the widget) stopped working, have had no actual value, no chart ... nothing

I was scrolling through tiktok around 40m, closed it and widget on homescreen it was blank (no value, no chart) waited 5m ... no data refreshed opened libre follow app => data is available Opened the app to see if there is an error in console - open console - value there downloaded direct closed the app - value gone (other issue - start/close app resets widget) ... and now started again to draw a line

Think this needs some more investigating somehow, I did definitely not open the app in the middle but nevertheless data was lost in the widget without opening the app ... (app is as you mentioned "not optimized" in the accu settings - nevertheless phone was ON and used while it happened)

nigzak commented 9 months ago

I installed latest update (0.9.8) today (I have disabled auto-updates because I don't want freestyle to install updates ... there are so many bad reviews that I want to decide on my own :D )

It seems as of first look that all with the widget is fixed with this, I will observe this the next days.

If there is still something I will write it here, if all is fine I will close this.

Thanks for the fast update :)

nigzak commented 9 months ago

I wanted even to close it today, I did not find any bad thing happening on my phone now, again - thank you very much for your fast fix @trupici :D