-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
package will not work when Chrome local cache is in place #6
Comments
You're right, I haven't thought about this issue. Thanks for the report |
I just tested the changes for the first time. I followed the steps you outlined:
I expected to now see the same overlay+message. Even after waiting 10 seconds, the screen is still white with no message. Are you seeing a different behaviour? |
Yes I installed I did notice now that the cursor becomes "not-allowed" when I re-open the tab so something is happening, and I also see a javascript error. See the GIF screencast beloe. |
Do you have your version deployed anywhere so I can test other browsers on other devices? |
I found the problem. I guess you are using a Windows machine. This is Windows specific. I am using a Linux machine and it worked well. The shiny server deployment is also Linux so I couldn't replicate this. I tried on my Windows machine today and found it is because shiny js behaves differently on Win and Linux. It turns out when the Shiny js runs on Win, it first setup the socket value in So, my original script detects if there is a socket been set up. It finds the solution: This time I check the state |
Thanks for looking into this and explaining. It does work now, but I also get a javascript error:
It's referring to Should it check also for null? |
I noticed an issue today with this PR. I was developing a shiny app that was using shinydisconnect, and my version of shinydisconnect is the one from this PR. I opened the app in a browser and killed the R session almost immediately. The shiny app initially showed a message "An error occured. Please refresh the page and tried again" and after 3 seconds it changed the message to "Cannot connect to the server". I suppose the solution could be to check if a message is already shown to the user |
Let me know if these fix the problems |
I didn't bookmark the notification from this repo so I forgot about it. I'm making this comment so that I'll get a notification on my main account and be able to "bookmark" it :) |
No problem. Thanks for reminding me on this too. I almost forget what changes I made. I remember I made another commit to fix things as you suggested, but maybe you can take a look at what we have so far and tell me if other things need to be fixed. |
A simple example:
shinydisconnect
example locally on Chrome, you should see a tab opens.or:
You will find the app is back, All UI is clickable. As expected, for those need the backend will not work, but still, users can play around which is not ideal. In the original Shiny, this is prevented by the
shiny-disconnected-overlay
. Sine you disabled it#shiny-disconnected-overlay { display: none !important; }
, the protection is gone.Here is what I did:
#shiny-disconnected-overlay
back but one layer below 99997, so the#ss-connect-dialog
is till on top.ss-connect-dialog
to.shiny-discon::before
and.shiny-discon-noserver
. I toggle the class later in js.disconnetMessage
on the UI side, just like your other examples which are fine, my checker will be deleted after first 3s. In your, demo, you insert this to DOM and immediately stops the sever. So the script is inserted at the same time as the server closes. So my function runs after the sever is ended. So, it will first display your error message but 3s later change to "Cannot connect to the server". To fix this, I fake the socket after shinyapps.js delete it:I tried locally and deployed it to my account with no problem, fixed this issue. Please try it out #5 .
The text was updated successfully, but these errors were encountered: