source-academy / frontend

Frontend of Source Academy, an online experiential environment for computational thinking (React, Redux, Saga, Blueprint)
https://sourceacademy.org
Apache License 2.0
103 stars 168 forks source link

Gracefully handle situations where the browser blocks access to IndexedDB #2238

Open ianyong opened 2 years ago

ianyong commented 2 years ago

Context

The file system for the playground relies on the browser's IndexedDB for storage. In some browsers such as Firefox, access to IndexedDB is entirely prohibited when in private browsing mode (and does not seem likely to be supported anytime soon).

Proposed Changes

To investigate how to gracefully handle such situations once the code editor is linked up to the file system. Ideally, even if IndexedDB is blocked, the user should still be able to work on single file programs.

ianyong commented 1 year ago

Will need to do a thorough check through of all the features to ensure that single-file functionality still works. Off the top of my head, share links for single-file programs do not work when IndexedDB is blocked because the application tries to write to the file system and fails.