[Core] Fix upload_private_file#83
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes issue #70 related to file upload functionality by correcting the MD5 checksum used in private file uploads. The main issue was that the protocol expects the MD5 hash of the first ~10MB of the file in certain fields, not the full file MD5.
Key changes:
- Refactored MD5 checksum calculation to be performed before creating the upload request
- Fixed
NotOnlineFile.FileMd5to use the correct 10MB MD5 checksum instead of the full file MD5 - Added
File10MMd5parameter toFileUploadEventReqto pass the 10MB checksum explicitly
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Lagrange.Core/Message/MessagePacker.cs | Fixed to use File10MMd5 instead of FileMd5 for the protocol message field |
| Lagrange.Core/Internal/Services/System/FileUploadService.cs | Removed duplicate MD5 calculation logic, now uses the pre-calculated value from the request |
| Lagrange.Core/Internal/Logic/OperationLogic.cs | Moved 10MB MD5 calculation before request creation; applied same fix to both SendFriendFile and SendGroupFile methods |
| Lagrange.Core/Internal/Events/System/FileUploadEvent.cs | Added md510m parameter and File10MMd5 property to the request event |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Wesley-Young
approved these changes
Nov 17, 2025
pk5ls20
approved these changes
Nov 17, 2025
XeronOwO
approved these changes
Nov 17, 2025
Bemly
pushed a commit
to Bemly/CharonAnchor
that referenced
this pull request
May 3, 2026
Co-authored-by: Wei FeiYang <wesley.f.young@outlook.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #70
Maybe not that elegant