Opened 9 months ago

Last modified 6 months ago

#14623 new defect

BACKENDS: iOS: Games and config being lost

Reported by: tghggns Owned by:
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
  1. Open the files app and navigate to the ScummVM directory. Ensure files app is left open in the background.
  2. Open ScummVM and add “The Dig” game.
  3. Start “The Dig” and two finger tap until gameplay begins (should see the three spacemen)
  4. Close ScummVM and swipe away (ensure it is not still running in the background
  5. Repeat steps 3-4
  6. Open ScummVM

Result: Games list and configs are cleared

https://s11.gifyu.com/images/S4TNu.gif

Change History (4)

comment:1 by tghggns, 9 months ago

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.

comment:2 by larsamannen, 8 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 tag2015, 7 months ago

Summary: Games and config being lostBACKENDS: iOS: Games and config being lost
Version: gsoc

comment:4 by criezy, 6 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.

Note: See TracTickets for help on using tickets.