ionide / proj-info

Parse and evaluate MsBuild project files
MIT License
64 stars 37 forks source link

Fix handling of bad cache data #140

Closed baronfel closed 2 years ago

baronfel commented 2 years ago

When testing 0.58.0 in FSAC, I discovered that project loading stalled. After some debugging, this was an interesting side effect of fixing the project cache serialization - now that we could load the cache files, we were loading files that had serialized incorrect data shapes - the previous serialization of the cache entries was just writing empty json objects. To prevent these stalls/crashes, I've done the deserialization in two steps - one to JObject so we can check if the object is empty, and then a second to the destination type.

I tested this on a drop-in version of FSAC and immediately projects started loading again. I also verified that this was in fact the problem by purging all the leftover fsac.cache files (we should make this name configurable...) and that also solved the problem. I don't want to ask users to clear these out, though, so a fix on our end is appropriate.