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

Temporarily disable saving playground state #1935

Merged
merged 1 commit into from
Mar 24, 2024
Merged

Conversation

mgeisler
Copy link
Collaborator

When browing around on https://google.github.io/comprehensive-rust/, I sooner or later end up in a state where the local storage has [] stored for a page with one or more playgrounds. The effect of this is that the code is removed from the page!

I am not sure why this happens, but I’m afraid the code here needs more testing. I’m teaching a class Monday morning, so I’ll disable the code from #1917 for now.

When browing around on https://google.github.io/comprehensive-rust/, I
sooner or later end up in a state where the local storage has `[]`
stored for a page with one or more playgrounds. The effect of this is
that the code is removed from the page!

I am not sure why this happens, but I’m afraid the code here needs
more testing. I’m teaching a class Monday morning, so I’ll disable
the code from #1917 for now.
@mgeisler mgeisler merged commit d5b92db into main Mar 24, 2024
35 checks passed
@mgeisler mgeisler deleted the disable-playground-saving branch March 24, 2024 22:25
@mgeisler
Copy link
Collaborator Author

Cc @djmitche, @fw-immunant, and @mani-chand. I merged this now so I can ensure the course works for the class I'm teaching in ~12 hours.

I only saw this after browsing around on the site for 30 minutes or so. I don't really know why it would happen, but I guess the event that saves the playgrounds is unreliable. I would suggest looking into saving the state on changes to the playgrounds instead of trying to detect navigating away from the pages.

I've seen problems with detecting the pagehide event in the past: the event is not reliably fired because it has been misused in the past.

I ran into another problem: clearing saved playground data doesn't fully work. Navigating away from the current page will save the playgrounds on the page again.

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

Successfully merging this pull request may close these issues.

1 participant