Browser storage: Unhelpful crash message when outdated code is stored
adamziel opened this issue · 2 comments
adamziel commented
When the browser storage is selected and the stored code is outdated and no longer compatible with the current version of Playground, we should:
- Provide a helpful error message stating the next steps
- Enable the export of the stored content to avoid losing your work
- Maybe? Try to auto-migrate within the constraints of the system
At the moment, you may see something like this and scratch your head thinking "Playground is broken":
Warning: require(/wordpress/wp-content/mu-plugins/playground-includes/wp_http_fetch.php): Failed to open stream: No such file or directory in /wordpress/wp-content/mu-plugins/0-playground.php on line 114
Fatal error: Uncaught Error: Failed opening required '/wordpress/wp-content/mu-plugins/playground-includes/wp_http_fetch.php' (include_path='.:') in /wordpress/wp-content/mu-plugins/0-playground.php:114 Stack trace: #0 /wordpress/wp-settings.php(2): include_once() #1 /wordpress/wp-config.php(101): require_once('/wordpress/wp-s...') #2 /wordpress/wp-load.php(2): require_once('/wordpress/wp-c...') #3 /wordpress/wp-blog-header.php(2): require_once('/wordpress/wp-l...') #4 /wordpress/index.php(2): require('/wordpress/wp-b...') #5 {main} thrown in /wordpress/wp-content/mu-plugins/0-playground.php on line 114
adamziel commented
Idea from @brandonpayton: Run an integrity check in the browser mode to confirm we're on the latest version before running the code. This sounds related to #566
adamziel commented
Boot protocol will solve this. It will prevent Playground from creating new files within the WordPress directory structure. Instead, it will load them from scratch on each boot which means they'll never get stale.