Fix EntityId truncate length in EntityChange constructor#25556
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an audit-logging persistence bug by ensuring EntityChange.EntityId is truncated using the correct max length constant (MaxEntityIdLength = 128) rather than MaxEntityTypeFullNameLength (512), aligning runtime truncation with the EF Core column constraint and preventing insert failures for long entity IDs.
Changes:
- Update
EntityChangeconstructor to truncateEntityIdwithEntityChangeConsts.MaxEntityIdLength(128). - Keep
EntityTypeFullNametruncation behavior unchanged (still usesMaxEntityTypeFullNameLength= 512).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## rel-10.4 #25556 +/- ##
============================================
- Coverage 49.41% 49.38% -0.03%
============================================
Files 3674 3671 -3
Lines 124021 123848 -173
Branches 9477 9466 -11
============================================
- Hits 61280 61167 -113
+ Misses 60919 60863 -56
+ Partials 1822 1818 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
EngincanV
approved these changes
Jun 5, 2026
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.
The
EntityChangeconstructor truncatedEntityIdwithMaxEntityTypeFullNameLength(512) instead ofMaxEntityIdLength(128), which mismatches the EF Core column length and can throw on insert.Resolves #25554