Skip to content

Don't use BinaryFormatter for ClientInfo - #565

Merged
ritchiecarroll merged 2 commits into
masterfrom
client-info-serialization
Jul 17, 2026
Merged

Don't use BinaryFormatter for ClientInfo#565
ritchiecarroll merged 2 commits into
masterfrom
client-info-serialization

Conversation

@StephenCWills

Copy link
Copy Markdown
Member

Replaces BinaryFormatter with custom serialization methods that utilize BigEndian and UTF-8. I chose not to implement ISupportBinaryImage because this class has a lot of immutable properties that need to be assigned in the constructor.

@ritchiecarroll

Copy link
Copy Markdown
Member

This looks fine. Presume you've have tested? Was trying to think of how this might break -- the only way that occurred to me was the rare case of using an old version console or manager with a new version of server (or vice/versa), like from different machines. I've done this before, but I don't recall any normal cases of us doing this in the field.

@StephenCWills

StephenCWills commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

Yes, I've indeed tested this.

As for how it could break, I decided that since this is a network protocol that is rarely used over any interface besides localhost, there should be very little risk in breaking the wire format. If we do need to keep things backwards compatible, then the fix will obviously be more complicated. To parse BinaryFormatter payloads, we can use Microsoft's recommendation, but I'd really rather treat backwards compatibility as a last resort.

https://learn.microsoft.com/en-us/dotnet/standard/serialization/binaryformatter-migration-guide/read-nrbf-payloads

@ritchiecarroll
ritchiecarroll merged commit b3aa904 into master Jul 17, 2026
3 checks passed
@ritchiecarroll
ritchiecarroll deleted the client-info-serialization branch July 17, 2026 20:41
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.

2 participants