-
Notifications
You must be signed in to change notification settings - Fork 129
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
Vanilla js-dos v7.x loses saved changes after 3rd / 4th persist #293
Comments
Interesting, sounds like a bug. |
By the way, does it reproduce on DOS.Zone? By default, it's using JS-DOS v8. (on desktop) |
It also depends if you logged or not, in case if you are logged game is loaded from cloud not from indexeddb. |
Haven't tested on dos.zone, but on v7 I could reproduce this by implementing a custom persist (localStorage instead of indexedDB). The results were the same, so my hunch is that there's an issue in properly detecting "changes" in a bundle, and it's not the storage/persist mechanism. |
For test I'm running latest js-dos from js-dos.com and Wolfenstein 3D bundle from dos.zone. But this issue happens on any game I test.
Starting a game, saving in-game (slot 1, I name it "1") and then pressing the js-dos disk icon to persist changes into indexedDB. This works as expected. Reloading, doing is again, saving a second time (slot 2, named "2"), works as well.
But after a 3rd or 4th time, this loop will result in losing earlier saved changes, like this:
I expected my save games 1 to 5 to remain present.
My hunch is that the actual changes on disk are not compared properly to the original bundle, but to an earlier "changed" state. As such, in this process, the newest ".changes" in indexedDB keeps on losing earlier save games.
This is the simplest html I run on localhost:
The text was updated successfully, but these errors were encountered: