applejag / Newtonsoft.Json-for-Unity.Converters

Converters of common Unity types for Newtonsoft.Json. Goes hand in hand with jilleJr/Newtonsoft.Json-for-Unity
https://github.com/jilleJr/Newtonsoft.Json-for-Unity.Converters
MIT License
322 stars 36 forks source link

Bug: Configuration settings are not being used consistently #94

Open msamora-supernatural opened 4 months ago

msamora-supernatural commented 4 months ago

Expected behavior

We expect that the settings in Newtonsoft.Json-for-Unity.Converters.asset should be applied at all times.

Actual behavior

Often (~25% repro) when switching branches Newtonsoft.Json-for-Unity.Converters.asset will stop being used the next time you open the Unity Editor.

Steps to reproduce

Setup: Create a branch using version 1.5.1 Create a second branch upgraded to version 1.6.3 Create a json converter that throws NotImplementedExceptions for all functions in both branches Exclude the NotImplemented json converter in both branches

Steps: close unity switch branches open unity

Details

Closing and reopening the editor does not resolve this issue. Each time the issue is reproduced the user must open the settings, notice that they have all been reset to the default values in the Unity UI, and re-apply the correct settings.

Checklist

applejag commented 4 months ago

@msamora-supernatural thanks for such a detailed repro!

Does it still happen if you use the same version?

msamora-supernatural commented 4 months ago

@msamora-supernatural thanks for such a detailed repro!

Does it still happen if you use the same version?

This issue does not happen with version 1.5.1 We rolled back to this stable version, but we would like to upgrade so that we can take advantage of the startup time improvement that comes from disabling "auto type scanning" in version 1.6+

applejag commented 4 months ago

@msamora-supernatural if I get this right, then while staying at the same version the config is left untouched. But only when jumping back and forth between v1.5 and v1.6 it fails.

So workaround is to upgrade all branches to v1.5.1.

However, as you are creating this issue I assume that that's perhaps not a valid solution for you? I guess maybe the branch with v1.5.1 is under code freeze?

I do not really have time to dig deeper into this one right now and debug it in Unity. If you'd like to give it a go then please feel welcome to.

The way types are looked up was changed, as it now also uses the assembly name. Maybe related to that? I have a vague memory that we at least tried to not make it backwards incompatible. For reference, here's the diff: https://github.com/applejag/Newtonsoft.Json-for-Unity.Converters/compare/1.5.1...1.6.3

msamora-supernatural commented 4 months ago

@msamora-supernatural if I get this right, then while staying at the same version the config is left untouched. But only when jumping back and forth between v1.5 and v1.6 it fails.

So workaround is to upgrade all branches to v1.5.1.

However, as you are creating this issue I assume that that's perhaps not a valid solution for you? I guess maybe the branch with v1.5.1 is under code freeze?

I do not really have time to dig deeper into this one right now and debug it in Unity. If you'd like to give it a go then please feel welcome to.

The way types are looked up was changed, as it now also uses the assembly name. Maybe related to that? I have a vague memory that we at least tried to not make it backwards incompatible. For reference, here's the diff: 1.5.1...1.6.3

@applejag Thank you for the suggestion, but It isn't possible for me to update all of our branches at the same time. The issue seems to be related to https://github.com/applejag/Newtonsoft.Json-for-Unity.Converters/issues/82 the config is failing to load and this package is initializing with the default values.