Closed ovatsus closed 10 years ago
Strange, I have unit tests set up for maps. Can you verify that the bug persists if you use the Pickle/UnPickle methods instead of Serialize/Deserialize?
Adding a CLIMutable attribute to the record solves the problem, but I though that was not required. Json.NET gives a cast error between FSharpList to ICollection without the attribute, but FsPickler jsut fails silently, I would prefer it to also crash
I am unable to reproduce this problem. I used your type definitions and serialized/deserialized a singleton map using the Mock
entry. Could you possibly write a self-contained, bare-minimum script that reproduces the problem?
I'm still pretty convinced that the issue lies with your implementation. For example, I was able to verify that FsPickler works correctly in the following snippet:
https://gist.github.com/eiriktsarpalis/e477b8c9602769c34d0f
As you can see, I create a map using your crawler implementation, then successfully serialize and deserialize using the same workflow. A race condition, maybe?
Humm, It's possible, I'll close the issue then
Thanks
Let me know how it works out, a curious issue nonetheless.
Tried again, and it's working both with and without the CLIMutable, so I was doing something wrong before. In any case I'm keeping Json.Net, performance is not a problem, and json is easier to debug than a binary file
I agree, binary serialisers is probably not the best choice when persisting data.
I have a Map<string, Record>, and serialize it using:
I checked the file and it looks fine, but when I deserialize it again with
fsp.Deserialize<_>(stream)
I get an empty map