Skip to content

Conversation

@rockfordlhotka
Copy link
Member

#4767

From @JasonBock

I'm getting an exception with the metastate implementation. Well, I'm getting a couple, but here's one I found: System.ArgumentException : Metastate cannot be empty. (Parameter 'metastate'). The issue is that when I serialize an object that has no metastate, like a CommandBase, calling GetMetastate() returns a 0-byte array. Then, during deserialization, I pass that 0-byte array to SetMetastate(). I think the implementation in IMobileObjectMetastate.SetMetastate(Byte[] metastate) should handle this case and not consider it to be an error.


I'm also seeing what looks like weird metastate issues with the flag properties. For example, I have a test that fetches a BO, which means all of these properties are false: IsNew, IsDeleted, IsDirty, and IsChild. I then serialize the object, and it seems like the metastate values in the byte array are all 0, or false. But, when I deserialize the object, IsNew and IsDirty are true.

@rockfordlhotka rockfordlhotka merged commit 0dbacff into main Jan 7, 2026
2 checks passed
@rockfordlhotka rockfordlhotka deleted the 4767-metastate-fixes branch January 7, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants