Skip to content
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

why does random string get appended to app URL when deployed? #118

Closed
Tixierae opened this issue Jun 4, 2020 · 3 comments
Closed

why does random string get appended to app URL when deployed? #118

Tixierae opened this issue Jun 4, 2020 · 3 comments

Comments

@Tixierae
Copy link

@Tixierae Tixierae commented Jun 4, 2020

When deploying on shinyapps.io, my URL is not https://foo.shinyapps.io/my_foo_app/ but https://foo.shinyapps.io/my_foo_app/_w_0c836d12/.

Notice the _w_0c836d12 at the end. I suspect the culprit is shinyMobile, as I have never experienced that with any of my other apps (not relying on shinyMobile).

What is the meaning of such a random string? What are the implications?

Thanks!

@Tixierae Tixierae changed the title why does random string gets appended to app URL when deployed? why does random string get appended to app URL when deployed? Jun 4, 2020
@DivadNojnarg
Copy link
Member

@DivadNojnarg DivadNojnarg commented Jun 8, 2020

This corresponds to the shinyapps.io worker id. Whenever an R process becomes saturated by clients, a new process is created to guaranty a fluid experience. Nothing harmful.

@Tixierae
Copy link
Author

@Tixierae Tixierae commented Dec 18, 2020

Just to let you know and others that actually, that random string appended to the app's URL when not run locally CAN be harmul!!! E.g.: https://community.rstudio.com/t/w-in-shinyapps-io-url/69893

In my case, this was preventing me from consistently passing parameters via session$clientData$url_search, as illustrated here: https://vimeo.com/492431481/d617643247

The solution is to comment out one line in inst/framework7-5.7.8/my-app.js:

window.history.replaceState( {} , 'newpath', newpath);

One question though: can the line above be safely commented out? Could there be any unanticipated side effect?

Thanks!

@Tixierae
Copy link
Author

@Tixierae Tixierae commented Dec 20, 2020

After commenting out window.history.replaceState, the tab links are broken and the user cannot navigate the app anymore (see this screencast: https://vimeo.com/493012866/fb3a712dae).
Seems like the tab links are somehow still initialized with the worker ID in them, but then, because of the change above, the worker ID is removed upon first click, causing the links to become broken.
Could you please point me to the script where the tab links are initialized? I could not find it.
Any help would be greatly appreciated, thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants