fix: correct staleAfterMs unit and remove dead facade method#701
fix: correct staleAfterMs unit and remove dead facade method#701kamilwronka wants to merge 1 commit intodevelopfrom
Conversation
…facade - guilds.service.ts: multiply channelSnapshotStaleSeconds by 1000 to get milliseconds, matching channels.service.ts (was comparing seconds against Date.now() milliseconds, causing overly-aggressive refresh) - events.service.ts: remove unused calculateMemberPoints facade method and its sole import DEFAULT_ADVANCED_EVENT_SCORING_RULES (no callers outside spec file) - events.service.spec.ts: remove corresponding mock and test for the deleted method Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
💤 Files with no reviewable changes (2)
📝 WalkthroughWalkthroughThe pull request removes the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Summary
staleAfterMsinitialization — was storing raw seconds fromchannelSnapshotStaleSecondsinstead of multiplying by 1000 to get milliseconds. This caused the staleness check (Date.now() - updatedAt > staleAfterMs) to treat guild Discord sync as stale after ~300ms instead of ~5min, triggering unnecessary refresh calls. Now matcheschannels.service.tsbehavior.calculateMemberPointsfacade method (no callers outside its spec file) and its sole importDEFAULT_ADVANCED_EVENT_SCORING_RULES.Why each change is safe
staleAfterMs) and comparison target (Date.now()) both expect milliseconds. The identical pattern inchannels.service.tsalready uses* 1000.calculateMemberPointson the facade has zero callers outside the spec. The real scoring logic lives inEventPointsService.calculateMemberPointswhich is called directly.Touched files
apps/api/src/guilds/guilds.service.ts(1 line)apps/api/src/events/events.service.ts(removed 27 lines)apps/api/src/events/events.service.spec.ts(removed 16 lines)Residual risks
Test plan
tsc --noEmit)🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
Bug Fixes
Refactor
Tests