fix: GET /api/campaigns returns incorrect status when deadline is exa… - #751
Conversation
|
@0xElyte is attempting to deploy a commit to the ritik4ever's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@0xElyte Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughCampaign deadline evaluation now uses millisecond precision across progress, filtering, failed timestamp updates, and global statistics. Tests verify campaigns remain open at the exact deadline and become failed one millisecond afterward. ChangesCampaign deadline precision
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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 |
Closes #568
[BUG] GET /api/campaigns returns incorrect status when deadline is exactly now
Description:
When deadline === Date.now() (to the millisecond), campaign status flickers between open and failed on repeated requests depending on server clock drift.
Acceptance Criteria:
Status computed with strict deadline < Date.now() for failed.
Test added for exact boundary (deadline = now ± 1ms).
Status consistent across repeated calls within the same second.
Summary by CodeRabbit