-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
x/playground: refresh page by mistake will lead to irretrievable data loss #55296
Comments
Not sure if this is feasible. cc @toothrot |
Some other playgrounds (Rust, Kotlin) do keep the current source when reloading the page on Android. Ack, they are not the same as the Go playground and may use more complex or stateful user sessions. |
A fine mitigation would be the page leaving prompt "Are you sure? Data will be lost [Cancel] [OK]" when the user is leaving, and there is unsaved code changed (i.e. no snippet ID in the current URL). |
The code's text input could probably be stored in sessionStorage if this is not done already. |
I find it a little annoying that opening a "fresh" tab at https://play.rust-lang.org/ and https://dartpad.dev/ brings up the code from the last time I used them, which is probably unrelated and unwanted. I'd prefer we don't do the same. |
localStorage would do that. But not sessionStorage as each session is supposed to be "per tab" iirc. |
What version of Go are you using (
go version
)?go 1.19
Does this issue reproduce with the latest release?
yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I wrote code in playground with my android phone and lost my code after freshing page by mistake.
What did you expect to see?
Data saved and was still present.
What did you see instead?
Data lost and there was no way to recover it.
I could click share button to generate a page link before writting code in it
to save my data. But this is just a workaround(and there is no share button in golang.google.cn/play).
The text was updated successfully, but these errors were encountered: