Preserve message id casing in confirmation tokens#601
Preserve message id casing in confirmation tokens#601PrzemyslawKlys merged 2 commits intov2-speedygonzalesfrom
Conversation
|
Claude finished @PrzemyslawKlys's task —— View job Code Review Complete ✅I've reviewed this PR that preserves message ID casing in confirmation tokens. Here's my comprehensive feedback: Todo List:
📋 Review SummaryOverall Assessment: This is a high-quality, focused change that addresses a specific casing sensitivity issue with excellent test coverage. ✅ StrengthsCode Quality & Best Practices
Security
Performance
🧪 Test Coverage - ExcellentComprehensive test scenarios in
Test quality highlights:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 90c07818cb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .Select(id => id.Trim()) | ||
| .Distinct(StringComparer.OrdinalIgnoreCase) | ||
| .OrderBy(id => id, StringComparer.OrdinalIgnoreCase) | ||
| .Distinct(StringComparer.Ordinal) |
There was a problem hiding this comment.
Keep token dedupe aligned with preview normalization
Switching token deduplication to StringComparer.Ordinal makes case-variant IDs (for example "msg-1" and "MSG-1") hash as separate entries, but preview generation still normalizes IDs case-insensitively in MailMessageActionPreviewService.NormalizeMessageIds before issuing the token. That means a client can request a preview, then execute the same action payload with the returned token and hit confirmation_token_mismatch because validation now recomputes a different token from the raw request list. This is a regression introduced by the comparer change and breaks preview→execute confirmation flows for inputs that differ only by casing.
Useful? React with 👍 / 👎.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v2-speedygonzales #601 +/- ##
=====================================================
+ Coverage 50.79% 51.11% +0.32%
=====================================================
Files 473 473
Lines 31170 31170
Branches 5359 5359
=====================================================
+ Hits 15832 15933 +101
+ Misses 13380 13272 -108
- Partials 1958 1965 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Addressed the review in acb1e0a by aligning preview-side message-id normalization with the confirmation token comparer. Preview generation now preserves case-distinct ids the same way token validation does, and I added a preview-to-execute regression covering case-variant message ids. Verification:
|
|
Claude finished @PrzemyslawKlys's task —— View job 📋 Code Review Complete ✅I've reviewed this PR that preserves message ID casing in confirmation tokens. Here's my comprehensive feedback: Todo List:
📋 Review SummaryOverall Assessment: This is a high-quality, focused fix that successfully addresses the preview→execute regression while preserving message ID casing. The solution demonstrates excellent understanding of the problem and provides comprehensive test coverage. ✅ StrengthsCode Quality & Best Practices
Security
Performance
🧪 Test Coverage - ExcellentCore confirmation token tests in
Integration regression test in
Updated preview tests in
✅ Regression Fix VerificationThe latest commit ( Problem identified: Preview service was using Solution implemented:
|
Summary
Verification
dotnet build Sources/Mailozaurr.sln -c Debugdotnet test Sources/Mailozaurr.Tests/Mailozaurr.Tests.csproj -c Debug --filter "ApplicationMessageActionConfirmationTokensTests|ApplicationRoutingServicesTests|ApplicationMessageActionPreviewServiceTests"