Bangle.js: Notification can interrupt data uploads via App Loader/Web IDE Remote #3600

Open
opened 2024-02-28 17:12:44 +00:00 by Ganblejs · 3 comments
Contributor

Leaving this to keep track of the issue found here: #3153 (comment).

Please confirm that;

  • I have checked the website, and I didn't find a solution to my problem / an answer to my question.
  • I have searched the issues, and I didn't find a solution to my problem / an answer to my question.
  • I have read and understood the Codeberg Terms of Use for images or other type of content that I included here.

Where did you get Gadgetbridge from?

I built it myself from source code

What is your Gadgetbridge version?

0.79.1-banglejs-6f717344e (includes #3478 and #3153)

What happened?

Reference:


Found BANGLEJS2, 2v21.25
>
Connected to Android
>
Module messages not found
Module messageicons not found
 ____                 _
|  __|___ ___ ___ _ _|_|___ ___
|  __|_ -| . |  _| | | |   | . |
|____|___|  _|_| |___|_|_|_|___|
         |_| espruino.com
 2v21.25 (c) 2023 G.Williams
>
Uncaught SyntaxError: Got ID:t expected ','
 at line 1 col 516
...break;case\xd1\tkeep_left:imgGB({"t":"notify","id":1709118388,"src"...
                                     ^
>=\xd1PERmBAACAAOAB+AD+AP+B/+H3+PO+8c8w4wBwADgAHgAPAAfAAfAAfAAfAAeAAeAAcAA8AA4ABwADgA==;¨;¼\xd1\nkeep_right:img=\xd1PERmBAACAAOAA/AD+AP+A//D/fPueeceY4YBwADgAPAAeAB8AHwAfAB8ADwAPAAcAB4ADgAHAAOAAAA==;¨;¼\xd1\nuturn_left:img=\xd1lGRiBAAAH4AAP/AAP/wAPj8APAfAPAHgHgB4DgA8BwAOA4AHAcADsOMB/HPA7zvgd9/gOf/gHH/gDh/gBwfgA4DgAcBgAOAAAHAAADgAABw==;¨;¼\xd1\vuturn_right:img=\xd1lGRiBAAPwAAf+AAf/gAfj4AfAeAPAHgPADwHgA4DgAcBwAOA4AHAcBjhuB5x/A+57gP99wD/84A/8cAP8OAD8HAA4DgAMBwAAA4AAAcAAAA==;¨;¼\xd1\6finish:img=\xd1ŒHhsBAcAAAD/AAAH/wAAPB4AAeA4AAcAcAAYIcAA4cMAA48MAA4cMAAYAcAAcAcAAcA4AAOA4AAOBxjwHBzjwHjj/4Dnn/4B3P/4B+Pj4A8fj8Acfj8AI//8A",8192);
Uncaught SyntaxError: Got '=' expected EOF
 at line 1 col 1
=\xd1PERmBAACAAOAB+AD+AP+B/+H3+PO+8c8w4wBwADgAHgAPAAfAAfAAfA...
^
|___|
         |_| espruino.com
 2v21.25 (c) 2023 G.Williams
Uncaught SyntaxError: Got ',' expected EOF
 at line 21 col 3690 in messagegui.app.js
...VLarge,label:distance||""}]},]},{type:"txt",font:"6x8:2",labe...
                               ^
>

#3153 (comment)

So what's happened is it was in the middle of the upload, and you received a notification, which sent out GB({"t":"notify","id":1709118388,"src"... right in the middle of the stream of data coming from the IDE.

It could happen with the app loader too.

So it's not actually losing any data anywhere, it's inserting it where it shouldn't!

So we could detect if we'd been asked to send any data by the WebView in the last 5 seconds, and if so could delay sending any notifications until we were sure nothing had been sent for a while.

Or in fact we could just refuse to send any data to the Bangle from Gadgetbridge when the WebView is active, and send it all when it's closed...

#3153 (comment)

Do you have logs?

Yes, shared above in there referenced PR, and privately to @gfwilliams.

What gadget do you use?

Bangle.js 2

What is your Android version/manufacturer flavor?

Android 14

Leaving this to keep track of the issue found here: https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/3153#issuecomment-1597580. ### Please confirm that; - [x] I have checked the [website](https://gadgetbridge.org), and I didn't find a solution to my problem / an answer to my question. - [x] I have searched the [issues](https://codeberg.org/Freeyourgadget/Gadgetbridge/issues), and I didn't find a solution to my problem / an answer to my question. - [x] I have read and understood the [Codeberg Terms of Use](https://codeberg.org/Codeberg/org/src/branch/main/TermsOfUse.md) for images or other type of content that I included here. ### Where did you get Gadgetbridge from? I built it myself from source code ### What is your Gadgetbridge version? 0.79.1-banglejs-6f717344e (includes https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/3478 and https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/3153) ### What happened? Reference: > ``` > > Found BANGLEJS2, 2v21.25 > > > Connected to Android > > > Module messages not found > Module messageicons not found > ____ _ > | __|___ ___ ___ _ _|_|___ ___ > | __|_ -| . | _| | | | | . | > |____|___| _|_| |___|_|_|_|___| > |_| espruino.com > 2v21.25 (c) 2023 G.Williams > > > Uncaught SyntaxError: Got ID:t expected ',' > at line 1 col 516 > ...break;case\xd1\tkeep_left:imgGB({"t":"notify","id":1709118388,"src"... > ^ > >=\xd1PERmBAACAAOAB+AD+AP+B/+H3+PO+8c8w4wBwADgAHgAPAAfAAfAAfAAfAAeAAeAAcAA8AA4ABwADgA==;¨;¼\xd1\nkeep_right:img=\xd1PERmBAACAAOAA/AD+AP+A//D/fPueeceY4YBwADgAPAAeAB8AHwAfAB8ADwAPAAcAB4ADgAHAAOAAAA==;¨;¼\xd1\nuturn_left:img=\xd1lGRiBAAAH4AAP/AAP/wAPj8APAfAPAHgHgB4DgA8BwAOA4AHAcADsOMB/HPA7zvgd9/gOf/gHH/gDh/gBwfgA4DgAcBgAOAAAHAAADgAABw==;¨;¼\xd1\vuturn_right:img=\xd1lGRiBAAPwAAf+AAf/gAfj4AfAeAPAHgPADwHgA4DgAcBwAOA4AHAcBjhuB5x/A+57gP99wD/84A/8cAP8OAD8HAA4DgAMBwAAA4AAAcAAAA==;¨;¼\xd1\6finish:img=\xd1ŒHhsBAcAAAD/AAAH/wAAPB4AAeA4AAcAcAAYIcAA4cMAA48MAA4cMAAYAcAAcAcAAcA4AAOA4AAOBxjwHBzjwHjj/4Dnn/4B3P/4B+Pj4A8fj8Acfj8AI//8A",8192); > Uncaught SyntaxError: Got '=' expected EOF > at line 1 col 1 > =\xd1PERmBAACAAOAB+AD+AP+B/+H3+PO+8c8w4wBwADgAHgAPAAfAAfAAfA... > ^ > |___| > |_| espruino.com > 2v21.25 (c) 2023 G.Williams > Uncaught SyntaxError: Got ',' expected EOF > at line 21 col 3690 in messagegui.app.js > ...VLarge,label:distance||""}]},]},{type:"txt",font:"6x8:2",labe... > ^ > > > ``` *https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/3153#issuecomment-1593148* > So what's happened is it was in the middle of the upload, and you received a notification, which sent out GB({"t":"notify","id":1709118388,"src"... right in the middle of the stream of data coming from the IDE. > >It could happen with the app loader too. > >So it's not actually losing any data anywhere, it's inserting it where it shouldn't! > >So we could detect if we'd been asked to send any data by the WebView in the last 5 seconds, and if so could delay sending any notifications until we were sure nothing had been sent for a while. > >Or in fact we could just refuse to send any data to the Bangle from Gadgetbridge when the WebView is active, and send it all when it's closed... *https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/3153#issuecomment-1597580* ### Do you have logs? Yes, shared above in there referenced PR, and privately to @gfwilliams. ### What gadget do you use? Bangle.js 2 ### What is your Android version/manufacturer flavor? Android 14
joserebelo added the
Bangle.js
label 2024-02-28 20:25:08 +00:00
Member

If we set the device as busy while the webview is active, it should prevent external events from sending data.

However, one note: it has happened to me in the past on other devices that events triggered by the watch itself can cause this kind of issues, especially if that triggers a reply back from the phone (I don't think there's a lot of these events on the bangle, if at all).

If we set the device as busy while the webview is active, it should prevent external events from sending data. However, one note: it has happened to me in the past on other devices that events triggered by the watch itself can cause this kind of issues, especially if that triggers a reply back from the phone (I don't think there's a lot of these events on the bangle, if at all).
Author
Contributor

If we set the device as busy while the webview is active, it should prevent external events from sending data.

We discussed previously if the webview could be persisted in the background: #3286 (IIRC it might already be able to to a degree. Edit: see https://forum.espruino.com/conversations/386264/#comment16988419)

If that came to be I guess the device could end up perpetually busy? 😛

Just a thought for now. It might be better to not focus on that other issue to start with..

>If we set the device as busy while the webview is active, it should prevent external events from sending data. We discussed previously if the webview could be persisted in the background: https://codeberg.org/Freeyourgadget/Gadgetbridge/issues/3286 (IIRC it might already be able to to a degree. Edit: see https://forum.espruino.com/conversations/386264/#comment16988419) If that came to be I guess the device could end up perpetually busy? 😛 Just a thought for now. It might be better to not focus on that other issue to start with..
Member

I think even if the webview was open in the background, just setting the device as busy while the activity was actually active would be good enough?

I think even if the webview was open in the background, just setting the device as busy while the activity was actually active would be good enough?
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Freeyourgadget/Gadgetbridge#3600
No description provided.