-
Notifications
You must be signed in to change notification settings - Fork 47
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
How are exs:identity numbers assigned? #454
Comments
Issue-Label Bot is automatically applying the label Links: app homepage, dashboard and code for this bot. |
Good find, @gmkado! I am thinking that when I originally made this I was attempting to impact performance so that the generated id for each object in memory would only be calculated once per container/domain. As you denote, however, that results in unexpected IDs for subsequent serializations. I am in agreement that subsequent serializations of the same entity graph should produce the same XML each and every time (assuming all values/references are the same). I have produced a build for you here that addresses this here: That's the good news. The "bad" news is that while I could get this deployed to nuget tomorrow, I will be out of town for the following two weeks, and am hesitant to deploy to production and then ghost immediately. 😅 The concern here of course is that while all tests pass and everything "seems" to be OK with the new scope, someone might be using that as a "feature" (ahhh software!). I would rather be around to address this appropriately if that is the case. So, if you're able to work with the above in the meantime and that works for you, then that works for me. 👍 |
Works for me, thanks! |
Alrighty, this is now deployed and published in NuGet for you: Please let me know if you having any further problems and I will investigate. Closing for now.
|
I am running into an issue when I enable references in my configuration.
In my application I determine whether a data object requires saving to file by comparing it's md5 hash to a previously saved hash value stored separately. For some reason my unchanged objects that had references were always requiring a resave.
I tracked it down to the exs:identity and exs:reference numbers being incremented with every serialization. I'm guessing this is because there is some internal cache of the references and my "SaveAndRestore" function is causing Ref1/Ref2 to no longer be the same object.
I only care that the references within a given object are maintained. Is there a way to reset this internal cache so my exs:identity and exs:reference numbers always start at the same index for a given serialization?
Result:
A comparison of the serialization shows the root cause:
The text was updated successfully, but these errors were encountered: