Lrakotoson / Covid-19

🦠 Dashboard to follow in real time the Covid-19 evolution.
https://loicrakotoson.com/Covid-19/
MIT License
13 stars 10 forks source link

Concurrent sessions #13

Open hershkoy opened 4 years ago

hershkoy commented 4 years ago

I opened the link, It asked me to choose language, and after I choose English the site remained in Frensh

Lrakotoson commented 4 years ago

Hi @hershkoy ,
It is a bad loading of the application.
When you open the app, you have to choose the language and then a country.

However, there is a small delay between the language choice and the text input to choose the country where the language is available. The appl doesn't seem to handle this well.

For now, the best solution is to refresh the page, choose a language (..wait...) and choose a country.

I'm working on an option for the app to load only after we choose the language and the country.

I'm adding it in the To Do in case someone finds a better solution.

llubosz commented 4 years ago

Why don't we disable the country option? I think that no one will be upset. Also I think we should consider if it's possible to get desired language from browser settings with a fallback to english when not found in translations.

Lrakotoson commented 4 years ago

@hershkoy I think I found the root of the problem. Shinyapps.io doesn't handle concurrent users at all. Basically, with two simultaneous connections, the last one to choose the language keeps the language for both. Which is really very annoying.

Maybe the solution would be to use Docker and host the application on another server. Only, I don't know how to do that yet.

Lrakotoson commented 4 years ago

Why don't we disable the country option?

The News window depends on the chosen country

hershkoy commented 4 years ago

From what I read shinyapps support workers but only on Basic plan which is paid, so I don't know how much you want to do it. If you need help with docker, I might be able to help, I use it often (though never with R) Other option is to default to English+US, and let user switch afterwards.. There are some API that do IP2location, but I haven't used them for awhile, especially the free ones.

Lrakotoson commented 4 years ago

After 2 days of trying different solutions, it's time to face the facts, it's more complicated than I thought, I spent too much time on it. Looking at the Dashboard stats, the fact that there are 2 competing users is rare (4 times in 48 hours). So it's better to leave it like this for now.

Other option is to default to English+US, and let user switch afterwards..

I also thought of putting it in English by default, but it didn't eliminate the problem of simultaneous sessions if another person chooses a language while the first user's page is loading.

hershkoy commented 4 years ago

got it. don't waste time on it, there are probably more important things than this. But maybe at least add a message "wait until page loads before choosing the language", because for non french speaker some of the words are hard to understand :)

Lrakotoson commented 4 years ago

From what I read shinyapps support workers but only on Basic plan

The service/price ratio is very low. 38$/month for an extra user, it's a small budget to do that I didn't plan for (especially in these times of crisis 😢)

Maybe we'll activate the sponsor button? 🤔 I hear it's not very cost-effective.

Lrakotoson commented 4 years ago

But maybe at least add a message "wait until page loads before choosing the language"

It's the right thing to do, yes.

hershkoy commented 4 years ago

try to send them a message, ask for support in an open source service that is for the public benefit, maybe they will agree. But if no, just leave it open for now, it is not critical

llubosz commented 4 years ago

Guys, I'm not very familiar with R environment, but it looks like we can deploy our own shiny server (https://rstudio.com/products/shiny/shiny-server/). I'm a owner of standalone server in Hetzner, Germany (Xeon E3-1246V3, 32GB RAM, over 2TB of storage). I can setup a shiny server there if you want and host this project if it's possible. Free of charge of course!

Lrakotoson commented 4 years ago

@llubosz Thank you. Thank you, However the Shiny server is less advantageous than ShinyApps.io, and it still doesn't solve the problem of simultaneous sessions. I'm following a lead, I'll keep you posted.