gojsondiff has an error of diffing in certain cases.
But just switchign to josephburnett/jd doesn't feel right because a) it might also have encoding bugs, and b) there's also a legitimate need to just have full raw encoding of full states.
Make it so that records can detect their encoding of states and can save them according to it
[x] Add a test that verifies that the other encoders DON'T match on our input
[x] remove panics
[x] Logic to auto-detect which format the file is
[x] Have testdata examples within record package so we can test things like converting between different encodings, and so that fullPathSanityCheck can be package private. Once ChangeEncoding works, take the testdata/full.json and create a yudai derived one to verify the contents (should) be the same.
[x] Make fullPathSanityCheck package private and test it in the main testing routines in package
[x] Convert yudai.json to be the same actual contents as full.json so their values can be compared
[x] DefaultStateEncoding shouldn't be a global; could conflict with different library use
[x] Add joseph_burnett encoding
[x] Diagnose why joseph_burnett encoding isn't working (enable test in filesystem and return it from encoding() switch table). Likely a bug in josephburnett library
[x] In golden, we can have the default be Yudai, but if adding a state would fail to confirm, can convert to full at that point and from then on. And then every time we try to save a full we try to convert to yudai if it isn't, and only if the conversion fails do we save the full
[x] if the jospehburnett diffs don't work in general, should we change the encoding style to be just full and diff?
[x] Add josephburnett test in record/main_test.go (create the canonical file baesd on full.json)
[x] ChangeEncoding()
[x] Support full state patches
[x] Split out State() fetching logic by the three encoding types
[x] Switch default encoding to StateEncodingJosephBurnett
[x] Try to compress on save automatically; if error then expand
[x] There's a bug in memory where every so often the game when flipped to admin mode fails. Separate bug on that. No, it's recently introduced. Do a bisect and figure out what caused it and fix. No, the bug has been there for awhile, it's only switching to admin mode on first.
In the end, this ended up being a full encoding (fallback) and a diff encoding (default, as long as the underlying diff library doesn't have a problem in that instance)
Detected while fixing #648.
gojsondiff has an error of diffing in certain cases.
But just switchign to josephburnett/jd doesn't feel right because a) it might also have encoding bugs, and b) there's also a legitimate need to just have full raw encoding of full states.
Make it so that records can detect their encoding of states and can save them according to it