added decrementByValueInTimeBucket function#1337
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThis PR adds a new exported function decrementByValueInTimeBucket to the SlidingWindowCounters module. The function accepts a UTCTime and decrement Integer, then delegates to the existing decrementByValueImpl using the provided timestamp and standard key builders. ChangesSliding Window Counter Decrement Export
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@lib/mobility-core/src/Kernel/Utils/SlidingWindowCounters.hs`:
- Around line 267-278: Change decrementByValueInTimeBucket to require a concrete
UTCTime (not Maybe) so callers must supply an explicit timestamp and we do not
fall back to now inside decrementByValueImpl; update its type signature to
accept UTCTime and the implementation to call decrementByValueImpl directly with
that UTCTime (retain the same key builders: makeSWKeyForTime,
makeQuickAccessWindowCountKey, makeSlidingWindowKey), and update any callers to
pass a concrete UTCTime instead of Nothing to ensure bucket-specific decrements.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 57c59050-d243-438c-a644-e82183442115
📒 Files selected for processing (1)
lib/mobility-core/src/Kernel/Utils/SlidingWindowCounters.hs
200233f to
5357405
Compare
5357405 to
fde1474
Compare
Type of Change
Description
Additional Changes
Motivation and Context
How did you test it?
Checklist
./dev/format-all-files.shSummary by CodeRabbit