fix(storage): guard prepare timestamp serialization#420
Conversation
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
PR SummaryMedium Risk Overview In-memory writes use Tests and fixtures are updated to pass explicit UTC Reviewed by Cursor Bugbot for commit ce6899e. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
Warning Review limit reached
Next review available in: 42 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
Walkthrough
ChangesTimestamp validation and UTC propagation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/EventStore.Core.XUnit.Tests/Scavenge/Infrastructure/StreamMetadatas.cs (1)
29-39: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueDuplicate "now" constants risk drift.
EffectiveNowandEffectiveNowRecordTimestampencode the same instant but with differentDateTimeKind. Consider deriving one from the other (e.g.,EffectiveNow = DateTime.SpecifyKind(EffectiveNowRecordTimestamp, DateTimeKind.Unspecified)) so a future edit to the literal date doesn't desynchronize the two.♻️ Proposed consolidation
- public static DateTime EffectiveNow { get; } = new DateTime(2022, 1, 5, 00, 00, 00); - private static DateTime EffectiveNowRecordTimestamp { get; } = new DateTime(2022, 1, 5, 00, 00, 00, DateTimeKind.Utc); + private static DateTime EffectiveNowRecordTimestamp { get; } = new DateTime(2022, 1, 5, 00, 00, 00, DateTimeKind.Utc); + public static DateTime EffectiveNow { get; } = DateTime.SpecifyKind(EffectiveNowRecordTimestamp, DateTimeKind.Unspecified);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/EventStore.Core.XUnit.Tests/Scavenge/Infrastructure/StreamMetadatas.cs` around lines 29 - 39, Duplicate "now" constants should be consolidated to avoid drift. In StreamMetadatas, keep a single source of truth for the shared instant by deriving EffectiveNow from EffectiveNowRecordTimestamp (or vice versa) using the desired DateTimeKind, and update any dependent helpers like ScavengePointRec to use that shared value consistently. This ensures future edits to the literal date can’t desynchronize the two properties.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/EventStore.Core.XUnit.Tests/Scavenge/Infrastructure/StreamMetadatas.cs`:
- Around line 29-39: Duplicate "now" constants should be consolidated to avoid
drift. In StreamMetadatas, keep a single source of truth for the shared instant
by deriving EffectiveNow from EffectiveNowRecordTimestamp (or vice versa) using
the desired DateTimeKind, and update any dependent helpers like ScavengePointRec
to use that shared value consistently. This ensures future edits to the literal
date can’t desynchronize the two properties.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 84b9b015-97d6-467c-987c-e33e26d48bfb
📒 Files selected for processing (5)
src/EventStore.Core.Tests/TransactionLog/Scavenging/Helpers/TFChunkDbCreationHelper.cssrc/EventStore.Core.XUnit.Tests/Scavenge/Infrastructure/StreamMetadatas.cssrc/EventStore.Core.XUnit.Tests/TransactionLog/LogRecords/PrepareLogRecordViewTests.cssrc/EventStore.Core/Services/Storage/InMemory/SingleEventInMemoryStream.cssrc/EventStore.Core/TransactionLog/LogRecords/PrepareLogRecord.cs
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 93b637f. Configure here.
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>

Uh oh!
There was an error while loading. Please reload this page.