feat: filter approved OOO periods in user status retrieval#2589
feat: filter approved OOO periods in user status retrieval#2589prakashchoudhary07 merged 1 commit intodevelopfrom
Conversation
Summary by CodeRabbit
WalkthroughThis change modifies Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
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)
📝 Coding Plan
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 the current code and only fix it if needed.
Inline comments:
In `@utils/userStatus.js`:
- Around line 88-93: The Firestore query in utils/userStatus.js using
requestsModel with filters requestedBy, type, state and a range on until
requires a composite index; add a firestore.indexes.json (or add to
firebase.json indexes) that defines a composite index for the requests
collection with fields requestedBy (ASCENDING), type (ASCENDING), state
(ASCENDING), and until (ASCENDING). Ensure the index is deployed with firebase
deploy --only firestore:indexes so the query in utils/userStatus.js (the
snapshot query using REQUEST_STATE.APPROVED and windowStart) no longer throws
FAILED_PRECONDITION and causes the catch that returns an empty array (affecting
downstream logic in discordactions.js) to be bypassed.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 75d78654-4426-4580-9212-43902958f2ed
📒 Files selected for processing (1)
utils/userStatus.js
Date: 18-03-26
Developer Name: @vinit717
Description
Update the query to filter the request based on state
Documentation Updated?
Under Feature Flag
Database Changes
Breaking Changes
Development Tested?
Screenshots
Screenshot 1
Test Coverage
Screenshot 1
Additional Notes