-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed resolving json converters (included issue #75) #90
fixed resolving json converters (included issue #75) #90
Conversation
Thanks for creating this PR! But what is the issue you're trying to solve here? The code already does a Yes sorry. The unit tests require a sensitive value, which is not available when the PR is created by an outside contributor. When your PR is done, then I'll have to recreate it just so the tests can run |
The order of assemblies in array is non-deterministic. In my case this leads to conflicts between convetrers from this repo and the same convetrers embedded in RiderFlow assemblies (as internal classes). Calling Reverse() doesn't solve the problem because it just reverses the array. In result, RiderFlow converters appear at top of the array and break everything. My fix ensures that Newtonsoft.Json assemblies will be placed at the beginning of the array and mscorlib is at the end. I also left Reverse() so as not to break anything. But it seems useless to me. |
Ok, let's look what At the same time, this is what's written in the comments:
To be honest, I don’t understand how a simple Reverse() can guarantee such sorting. Obviously, it can't. That's why i sort the array explicitly (reversed array + order fix): reverse_and_order.txt. But I agree that two sorts seems a bit redundant. I would remove Reverse() if its only purpose is to move Newtonsoft.Json and mscorlib. Here another file with |
You're completely right, it's a bit redundant. And yes, that comment makes no sense. But just looking at the issue here, it seems that maybe better type resolution would improve this too. We're only looking up the type by type name right now, but what if we also looked it up on assembly name? When I wrote the serializableobject and editor thing, I made it only store the type name, as I noticed it would otherwise frequently forget my converter settings whenever the assembly changed (such as when just the version changed). One solution would be to store the assembly name separately, and then first try to look up on a specific assembly, but after that try look up on only the type name in any assembly. I've pushed some changes that should make type lookups much more stable. |
Wdyt? @Erifirin |
Yes! Now it works as expected. |
Sure! I did some further refactorings. Interesting asynchronous pair-programming we had there. Do you have any other changes in mind? Otherwise we can go ahead and merge this. |
No, I think it's ready to merge :). |
added explicit ordering of assemblies