Multithreaded Core Data

This year I worked on a Core Data application. All of the parts of its sync were in a single file, which as a result had too much state tracking. The result wasn’t just complicated, it was dangerous. Should a state change be missed, the operation would never complete.