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

Yet another critical glue error

ANSWERED

Hi there,

I am trying to implement an app for Ionic/Versa that displays a lot of multicoloured text and allows the user to scroll through it - sort of a simple "rich text" control.

When I started this app I was unaware of the new VirtualTileList widget which might suit my requirements, but it really is a lot of text (upwards of 16 kilobytes).

The app basically has a number of text area SVGs (statically allocated in index.gui) and as the user swipes, it is supposed to change the contents of each text area's text to give the illusion of scrolling.

However after scrolling one or two lines I get a "critical glue error 0" and the app exits with no useful explanation of what went wrong.

All my SVGs have IDs so it's not that.

I've searched for this and not found any helpful answer.

Is this a bug in the Fitbit OS? Should I try to use a VirtualTileList instead (and risk running out of RAM)?

Any help would be appreciated as this is driving me up the wall.

To recap, all I'm trying to do is modify lots of text areas rapidly.

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

I've established what the issue is more precisely now.

JavaScript doesn't seem to like it if you modify a text's properties (or whatever they're called, like x, y, text etc.) inside a callback function such as onmousemove. This causes the weird behaviour including glue errors. Presumably these callbacks are happening in another thread? Anyway, something is causing the SVGs to become corrupted.

I fixed it by setting a flag in onmousemove, and checking that flag periodically with setInterval, then performing the SVG stuff in the interval function.

Does anyone know, is this specifically a Fitbit problem, or does it happen in browsers too? Just curious. It should be documented or fixed. Really frustrating!

View best answer in original post

Best Answer
0 Votes
2 REPLIES 2

Okay well I hesitate to say this is solved, but I found the problem by a process of elimination (commenting out lines until it stopped crashing).

I was using an invisible (display="none") text area to ascertain the width of strings in order to implement word wrap.

I think (not sure) that this was upsetting the JS implementation for some reason.

I really wish someone would fix the glue error message as it's one of the most opaque messages I've ever seen and resulted in a 3 day bug hunt for me.

Best Answer

I've established what the issue is more precisely now.

JavaScript doesn't seem to like it if you modify a text's properties (or whatever they're called, like x, y, text etc.) inside a callback function such as onmousemove. This causes the weird behaviour including glue errors. Presumably these callbacks are happening in another thread? Anyway, something is causing the SVGs to become corrupted.

I fixed it by setting a flag in onmousemove, and checking that flag periodically with setInterval, then performing the SVG stuff in the interval function.

Does anyone know, is this specifically a Fitbit problem, or does it happen in browsers too? Just curious. It should be documented or fixed. Really frustrating!

Best Answer
0 Votes