[RESOLVED] Issue creating chart on Gladys+

Thanks for your feedback this morning @spenceur, it really helped me because I managed to reproduce the bug with your JSON!

Actually, your JSON was 200 KB (before gzip), and I did a local test, I get an error « Max call stack exceeded Â» when trying to encrypt/decrypt this JSON during the decryption phase.

The issue was with the function that converted the decrypted message (an ArrayBuffer) to a String.

And so far, I was using a custom function to perform this ArrayBuffer to String conversion, but now there is a class available in all browsers that allows this conversion, so I switched to the native class :slight_smile:

I made a PR if you’re interested:

I’ll keep you posted when it goes to Gladys!

Well, it’s not as simple as that, my change breaks the encoding of special characters (accent, emoji, etc..)

I continue the investigation

The old-fashioned way :slight_smile: é

Actually, I found that to go through the browser’s « TextDecoder Â» API, you must go through the « TextEncoder Â» API to have consistent content! At the same time, it makes sense :slight_smile: I did tests with special characters (accents / emojis) and it works.

So, to have a smooth migration without breaking anything in existing instances, I coded the new mechanism, but I put it under a flag. Thus, Gladys instances will all be ready to decode these « new Gladys Plus payloads Â», but for now, they do not encode in this format.

I will do a release in 2 versions:

  • 1st release: the code arrives on the machines and on the Gladys Plus frontend, but not activated
  • 2nd release once everyone has moved to the 1st release: We activate the flag on Gladys and on Gladys Plus. Since everyone already has the code, we just need to check in the messages if there is the flag :slight_smile:

The code with the flag is available here:

For information @spenceur, Gladys Assistant v4.8.2, released this morning, is the first release.

This version does not fix your bug! :smiley:

This version only adds the new encoding function, which will then be activated via a flag change in a future release, only when all instances are up to date and have the function.

The idea of doing this in 2 releases is to not break Gladys Plus, but to do it smoothly without service interruption.

More information:

@spenceur It’s good, the fix is deployed with Gladys Assistant v4.8.3 :slight_smile: I did a test at home with the payload you sent me after our call, and it fixes the problem well!

Let me know if it works well for you once you’re on v4.8.3. On the more.gladysassistant.com side, you may need to hard-refresh the page to get the latest version of the PWA!

No problem once my internet is back. A technician was supposed to come this morning but no news ^^'.

I’ll keep you updated!

Hello @spenceur! Have you been able to re-test since? :slight_smile:

Hello!
I hadn’t forgotten you, but I didn’t have a PC on hand to try!

On the Mac, after clearing the cache, everything is fine ^^
However, on the Android phone, the same issue persists, but it’s probably a cache issue ^^

Great work, I contribute as much as I can to this gladys4 :slight_smile:

Great! That’s cool :slight_smile: :slight_smile:

Probably a cache issue yes, in fact the PWA updates automatically in the background, but it can take a little time. Usually after 1-2 refreshes you are on the right version, it will come smoothly :wink: