Websocket issue
Hi,
I would like to deploy a Shiny Application in an enterprise context where rhandsontable would be a table that the users could edit (and store the results back in some DB).
Everything works fine locally - but it often fails to work in our ShinyProxy environment. It simply crashes - without any error messages. The only error message that we get is this (from the Chrome console): "Could not decode a text frame as UTF-8". Sometimes it occurs when the table is drawn - sometimes it occurs after the table is already in the UI. I cannot give you a reproducible example at this point of time - but I could actually create an application where only the table was drawn - and reported pretty much the same error message every now and then.
Since there are quite a few things involed, I am not certain whether it is related to this library but I actually have something in my mind.
I am wondering how rhandsontable comminicates through websockets. Since the table crashes quite unexpectedly - without error messages, it is extremely difficult to debug.
Is there any special character that (r)handsontable does not prefer? If we deal with a relatively large table - how does rhandsontable comminicate through the client and the server? Can it be the root of the problem that rhandsontable tries to send something large to the client (since the table is simply too large) or the client tries to send something back in json format - that is simply too large and takes a lot of time? In our environment, there are quite a few time-outs - I suspect that rhandsontable tries to send something in the background - that it can deliver locally, but fails to do so when deployed through nginx (reverse proxy).
Thanks in advance,
Tamas
Hi, I don't know much about the websocket communication but I did have an issue with non-UTF8 characters at one point. Of course providing code would be very helpful but for now maybe try to use the iconv() function on the data before sending it to the client. This function will ensure that any unacceptable characters are replaced.
It looks like the issue was related with character encoding. Once I set the character encoding to en_US.UTF-8 globally and I do remove all those characters from the data that look like <U+...> - the issue is not reproducible.
At this point of time I cannot say strictly that this is rhandsomtable related - but it may be worth investigating how handsontable handles special types of char encodings. I am fine with the en_US.UTF-8 - so the issue can be closed.
Hi, @thomasthomasth.
I'm having the same problem with shinyproxy. My application works well, however, sometimes the error below appears on the browser console (chrome) and the page goes offline (gray). I'm not using the handsontable package, but the error is similar.

I inserted this command line in the global.R file of my shiny application, but the error persists.
Sys.setlocale(category = "LC_ALL", locale = "en_US.UTF-8")
Also, in the application's Dockerfile file, I changed the LC_ALL, but it didn't help.
RUN apt-get install -y locales
RUN locale-gen "en_US.UTF-8"
RUN update-locale "LC_ALL=en_US.UTF-8" "LANG=en_US.UTF-8"
RUN cat /etc/default/locale
How did you set the character encoding to en_US.UTF-8 globally? Also I didn't find any character as <U+...>...
Thank you.