After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 769938 - Handle failures when resuming a game
Handle failures when resuming a game
Status: RESOLVED FIXED
Product: gnome-games
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Games maintainers
GNOME Games maintainers
Depends on:
Blocks:
 
 
Reported: 2016-08-15 14:35 UTC by Mathieu Bridon
Modified: 2016-08-16 16:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
retro: Don't translate a message that won't be user-facing (1.01 KB, patch)
2016-08-15 14:35 UTC, Mathieu Bridon
committed Details | Review
retro: Don't try to load the state if its size is wrong (1.75 KB, patch)
2016-08-15 14:35 UTC, Mathieu Bridon
committed Details | Review
ui: Handle failures when resuming (5.83 KB, patch)
2016-08-15 14:35 UTC, Mathieu Bridon
committed Details | Review

Description Mathieu Bridon 2016-08-15 14:35:22 UTC
.
Comment 1 Mathieu Bridon 2016-08-15 14:35:26 UTC
Created attachment 333366 [details] [review]
retro: Don't translate a message that won't be user-facing
Comment 2 Mathieu Bridon 2016-08-15 14:35:34 UTC
Created attachment 333367 [details] [review]
retro: Don't try to load the state if its size is wrong

The core is supposed to return serialized data of a certain, expected
size.

Unfortunately, they often don't.

When that happens, we probably shouldn't try to load the serialized
state, as it is potentially bad.

Unfortunately, it might also be correct.

If we don't load such serialized data and it was correct, the player
will lose the state of their game, which is pretty bad.

However if we try loading such serialized data and it was bad, then the
core will just completely freeze the whole application, with no way for
the user to even close it.

The second option seems even worse, so with this commit we throw an
error when the size wasn't the expected one.
Comment 3 Mathieu Bridon 2016-08-15 14:35:41 UTC
Created attachment 333368 [details] [review]
ui: Handle failures when resuming

Sometimes, resuming the saved state of a game won't work, because the
snapshot will be corrupted.

When that happens, we now inform the user that something went wrong, and
offer them to restart the game from the main menu.
Comment 4 Adrien Plazas 2016-08-16 16:19:29 UTC
Attachment 333366 [details] pushed as f22cd0f - retro: Don't translate a message that won't be user-facing
Attachment 333367 [details] pushed as d27b382 - retro: Don't try to load the state if its size is wrong
Attachment 333368 [details] pushed as 77ee9bd - ui: Handle failures when resuming