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 ![]()
I made a PR if youâre interested:
Iâll keep you posted when it goes to Gladys!
The old-fashioned way
é
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
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

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! ![]()
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
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? ![]()
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 ![]()
Great! Thatâs cool
![]()
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 ![]()
