Open curiousdannii opened 1 year ago
Here are all the calls to file_write
and file_read
:
file_write
close
calls with raw data converted to an ASCII stringopen
calls with raw ""
gli_stream_flush_file
calls with Array<number>
glk_stream_close
calls with Array<number>
glk_stream_open_file
/glk_stream_open_file_uni
calls with raw ""
restore_allstate
calls with raw ""
file_read
open
calls with raw: trueglk_stream_open_file
/glk_stream_open_file_uni
calls with raw: falserestore_allstate
calls with raw: falseThis is a good sign: aside from emglkenfs.js, raw mode is only ever used to set an empty file. So I'm thinking I'll consider uses of file_write
that write a raw text other than ""
to be deprecated.
It was reported here that Counterfeit Monkey can have trouble saving/restoring save files, but it can happen to any storyfile: https://github.com/i7/counterfeit-monkey/issues/191. More discussion on the forum.
The issue is that the localStorage is getting too full to store the save file, which is about 150KB, out of the total 5MB that the browser can store. If you've been playing lots of things in Parchment then even if you haven't been making lots of save files there could be lots of autosaves taking up space. Then when you try to restore, it fails because the save file is empty.
Parchment/Dialog could be storing data in localStorage much more efficiently, and it could be using IndexedDB, which has much bigger limits (over a GB I think), and it could also be evicting autosaves to make space. I have plans to make those sorts of changes (#11), but they're not short term plans, it will take a lot of work to get everything ready.
What can we do about this?