Follow-up from "EA Tracking"
The following discussions from !5119 (merged) should be addressed:
-
@ChrisSchinnerl started a discussion: (+2 comments) Also don't we always need to reset the balance? Because otherwise, the delta of the spending will keep drifting apart.
-
@ChrisSchinnerl started a discussion: (+1 comment) Just because both files exist, it's not save to delete the tmp one. The other one might be corrupt at this point. You need to check whether the temporary file is clean and if it is, delete the original one.
-
@ChrisSchinnerl started a discussion: This execution path is not closing the tmpFile. Actually none of the execution paths except for the one reaching the end of this method are.
-
@ChrisSchinnerl started a discussion: Hm I'm still not sure I like the style of assigning the open file handle before the upgrade/loading procedure is done. This invites errors like overwriting the field and forgetting to close it. It also forces upgrade helpers to be methods instead of functions which are harder to unit test.
In my opinion it's usually best to finish the upgrading and loading and only when all the i/o is done, assign the final file handle and loaded data structures.
-
@ChrisSchinnerl started a discussion: (+1 comment) ?