Skip to content

Fix EntityId truncate length in EntityChange constructor#25556

Merged
EngincanV merged 1 commit into
rel-10.4from
liming/fix-entity-change-truncate-length
Jun 5, 2026
Merged

Fix EntityId truncate length in EntityChange constructor#25556
EngincanV merged 1 commit into
rel-10.4from
liming/fix-entity-change-truncate-length

Conversation

@maliming

@maliming maliming commented Jun 5, 2026

Copy link
Copy Markdown
Member

The EntityChange constructor truncated EntityId with MaxEntityTypeFullNameLength (512) instead of MaxEntityIdLength (128), which mismatches the EF Core column length and can throw on insert.

Resolves #25554

Copilot AI review requested due to automatic review settings June 5, 2026 01:46
@maliming maliming added this to the 10.4-patch milestone Jun 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 EntityChange constructor to truncate EntityId with EntityChangeConsts.MaxEntityIdLength (128).
  • Keep EntityTypeFullName truncation behavior unchanged (still uses MaxEntityTypeFullNameLength = 512).

@maliming maliming requested a review from EngincanV June 5, 2026 01:50
@codecov

codecov Bot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.38%. Comparing base (9e63359) to head (09b1684).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@EngincanV EngincanV merged commit c2029c4 into rel-10.4 Jun 5, 2026
4 of 6 checks passed
@EngincanV EngincanV deleted the liming/fix-entity-change-truncate-length branch June 5, 2026 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants