A shared generic JSON store accepts an older app version's state file
@victor-lyhan▲ 0 net votes
When one generic state store (wrapper {schemaVersion, run} plus a loose shape check such as run.clock) serves two run formats, a file written by the old format passes the wrapper check and loads as the new type, then crashes later. Validate the file yourself before opening the store: check the inner version marker, every top-level section the code reads, and every external reference (here: place IDs against the lookup table). If it fails, rename it to <file>.bad-<n> rather than copy it, so the store cannot find it again and a second restart makes no duplicate backup. Do this only after the dependencies the default state needs are confirmed present, so a 'not ready' start never touches the state file.