#14623 closed defect (fixed)
BACKENDS: iOS: Games and config being lost
Reported by: | tghggns | Owned by: | lephilousophe |
---|---|---|---|
Priority: | normal | Component: | Port: iOS |
Version: | Keywords: | iOS config | |
Cc: | tghggns | Game: |
Description
App version: Testflight beta 2.8.0
iOS version: 16.6.1
Device: iPad pro 11-inch 3rd Gen M1
Description:
Games list is being wiped and config is reset upon opening the app.
Games can be readded and configs restored manually.
This has happened a number of times through normal use of the app using various games, however I have found it is easiest to reproduce using a specific game detailed below.
To reproduce:
- Remove default games and demos (start with a blank games list)
- Have “The Dig” game files ready to load
- Open the files app and navigate to the ScummVM directory. Ensure files app is left open in the background.
- Open ScummVM and add “The Dig” game.
- Start “The Dig” and two finger tap until gameplay begins (should see the three spacemen)
- Close ScummVM and swipe away (ensure it is not still running in the background
- Repeat steps 3-4
- Open ScummVM
Result: Games list and configs are cleared
Change History (8)
comment:1 by , 14 months ago
comment:2 by , 13 months ago
This can happen when playing games supporting auto save and if putting the app to background (just by closing it) and then kills it by swiping away the app.
The app will be killed before having saved the new config file.
Until we've implemented saving into a temp file which then replaces the config file it's not recommended to kill ScummVM that way.
comment:3 by , 13 months ago
Summary: | Games and config being lost → BACKENDS: iOS: Games and config being lost |
---|---|
Version: | gsoc |
comment:4 by , 12 months ago
I have created a pull request to remove one of the main cause for this bug (saving the state of ScummVM to the config file when it is closed while playing a game). Instead the state is saved to a separate file.
https://github.com/scummvm/scummvm/pull/5515
This does not fully fix the bug, but it should happen a lot less often. As written by larsamannen previously, to properly fix the bug and avoid file corruption when killing ScummVM while it is writing a file, we will need to modify how files are written, to write first to a new file with a temporary name, and only when writing has finished we can rename the file to replace the old file. Note that in theory this does not only impact the config file, but we could be writing corrupted savefiles, so we may want to write the fix in a general way for all files that we write.
comment:5 by , 7 weeks ago
Owner: | set to |
---|---|
Resolution: | → fixed |
Status: | new → closed |
This should have been fixed by PR #6150 which has now been merged.
comment:6 by , 7 weeks ago
LOL that this is fixed by a commit that broke *all* config writes on Windows. You sure?
comment:7 by , 7 weeks ago
Actually this was fixed by criezy a long time ago by saving the config in a temp file before swapping the real one. That fix was only in the iOS backend. However a similar thing happened in Android which led to the atomic saves commit. So don’t blame this bug for that ;)
comment:8 by , 7 weeks ago
Being a loud little bitch is one of my strategies for getting bugs fixed on this project =)
That said, we have plenty of open tickets where that strategy has yet to succeed...
Note: the method described above is a guaranteed way to reproduce, however the issue is more prevalent and occurs without the Files app running in the background. The issue seems to be related to exiting and closing ScummVM mid game.