-
Notifications
You must be signed in to change notification settings - Fork 8
[fix] Align trust check with session protocol version #254
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
[fix] Align trust check with session protocol version #254
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the trust check mechanism to validate joiners against the session protocol version instead of using a generic compatibility check. The session protocol version is now persisted from the creator at session creation time, providing a consistent baseline for compatibility validation.
- Added a
ProtocolVersionproperty toCloudSessionDatato store the session's protocol version - Modified trust check logic to compare joiner protocol version against the session protocol version (with fallback to creator member's version)
- Updated unit tests to reflect the new protocol version matching behavior
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| CloudSessionData.cs | Adds ProtocolVersion property to store session's protocol version |
| CreateSessionCommandHandler.cs | Initializes session protocol version from creator's public key info during session creation |
| StartTrustCheckCommandHandler.cs | Changes trust check to compare joiner version with session version instead of using ProtocolVersion.IsCompatible |
| StartTrustCheckCommandHandlerTests.cs | Updates tests to set session protocol version and validates new comparison logic |
| CreateSessionCommandHandlerTests.cs | Adds assertion to verify protocol version is properly initialized during session creation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/ByteSync.ServerCommon/Commands/Trusts/StartTrustCheckCommandHandler.cs
Outdated
Show resolved
Hide resolved
src/ByteSync.ServerCommon/Commands/Trusts/StartTrustCheckCommandHandler.cs
Outdated
Show resolved
Hide resolved
src/ByteSync.ServerCommon/Commands/CloudSessions/CreateSessionCommandHandler.cs
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.



Summary
Main modifications
Implementation approach