← Back to team overview

widelands-dev team mailing list archive

Re: [Merge] lp:~widelands-dev/widelands/robust-file-saving into lp:widelands

 

Merry Christmas, and thanks for testing.

As for "ways to break it", there *should* at least be no new ways to do so. After all, the main purpose of this branch is to prevent any such breaking when we save maps/games. (And there aren't a lot of new things that could break on their own.) The actual saving routine itself could potentially break somewhere (I didn't change anything there), but as long as that involves throwing an exception, it will be caught.

Under Windows I tested this quite a lot myself. Usually, errors should "normally" not happen without someone trying to force them. Error scenarios that could be forced for testing would be:
1) after choosing a dir and filename, replace the dir by a non-dir file of that name, then try saving -> dir creation fails
2) lock a file (e.g. open it with a zip packer or so that locks the file), then try saving to that file -> renaming (for backup) fails
3) make a file read-only, then try saving to that file -> deleting backup (renamed file) fails (no ingame message though)
4) try saving on a read-only medium -> saving data fails
(There might be slight differences between platforms, especially with the file locking.)

Other errors would actually be hard to set off on purpose. That would likely require different processes to access the same file at the same time. Hard to even force, and extremely unlikely to happen by accident, but such errors are caught just in case. (In my testing for those scenarios I just temporarily added exceptions throws at some places.)

-- 
https://code.launchpad.net/~widelands-dev/widelands/robust-file-saving/+merge/358718
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/robust-file-saving.


References