Conversation
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/datasets/utils/occ-util.ts" line_range="19-21" />
<code_context>
+ * compares exactly, unaffected.
+ */
+function occComparisonBound(unmodifiedSince: Date): Date {
+ return unmodifiedSince.getMilliseconds() === 0
+ ? new Date(unmodifiedSince.getTime() + 999)
+ : unmodifiedSince;
+}
+
</code_context>
<issue_to_address>
**issue (bug_risk):** occComparisonBound treats every Date whose milliseconds are 0 as a coarse HTTP-date and widens it by 999 ms. A client that echoes an exact millisecond-precision updatedAt ending in .000 therefore gets a bound 999 ms later, so an intervening update within that second still matches the OCC filter and the stale client update succeeds.
**Triggers:** When a client sends the exact resource timestamp and that timestamp has zero milliseconds, such as 2026-01-01T00:00:00.000Z.
**Suggested fix:** Preserve whether the value came from a standard HTTP-date separately from the Date value, or use an explicit precision marker, instead of inferring precision from getMilliseconds() === 0.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
4 tasks
HayenNico
approved these changes
Sep 4, 2026
HayenNico
left a comment
Member
There was a problem hiding this comment.
The new logic looks good to me, I'd appreciate if someone else had a second look over the main changes in occ-util.ts before merging though.
All controller/service changes are solid and significantly reduce code duplication 👍
Member
There was a problem hiding this comment.
This file (and the .spec file) should be placed under common, they are not tied to datasets specifically
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.
Description
OCC comparisons had 2 problems:
It includes a refactor to avoid duplication
Tests included
Documentation
official documentation info
Summary by Sourcery
Fix optimistic concurrency comparisons and centralize conditional update handling across resource services.
Bug Fixes:
Enhancements:
Tests: