-
Notifications
You must be signed in to change notification settings - Fork 153
fix: OOO migration date issues #1112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: OOO migration date issues #1112
Conversation
WalkthroughThe change modifies how OOO (Out of Office) status parameters are passed to Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
app/components/user-status-modal.js (3)
49-57: Remove dead code: newStateObj is unused.The
newStateObjconstruction (lines 49-56) performs timestamp conversions and builds an object that is never used inupdateStatusBasedOnMode. This creates unnecessary overhead and confusion.🔎 Proposed refactor to remove dead code
@action async getCurrentStatusObj() { if (!this.isValidStatusChange()) return; - const updatedAt = Date.now(); - const newStateObj = { - updatedAt, - from: this.getFromTimestamp(), - until: this.getUntilTimestamp(), - message: this.reason, - state: this.args.newStatus, - }; - await this.updateStatusBasedOnMode(newStateObj); + await this.updateStatusBasedOnMode(); this.resetInputFields(); this.disableSubmitButton = true; }
85-100: Remove unused timestamp conversion from status object.The
fromanduntilfields computed ingetCurrentStatusObj(lines 53-54) are never used. TheupdateStatusBasedOnModemethod (line 107) doesn't accept parameters and instead usesthis.fromDateandthis.untilDatedirectly, making thegetFromTimestamp()andgetUntilTimestamp()calls dead code.Additionally,
updateStatusBasedOnModeonly handles the OOO status and has no logic for IDLE, even thoughisValidStatusChange()validates IDLE status input.Remove the unused
fromanduntilfields from thenewStateObjor refactorupdateStatusBasedOnModeto accept and use the status object parameter consistently. If IDLE status no longer needs timestamp handling, remove those branches from bothgetFromTimestamp()andgetUntilTimestamp().
107-115: Critical: Unused parameter and dead code.This method has two issues:
Parameter mismatch: The method is defined without parameters (line 107) but called with
newStateObjat line 57. The passed parameter is silently ignored.Dead code: The code builds
newStateObjwith timestamp values fromgetFromTimestamp()andgetUntilTimestamp()(lines 50-56), but then never uses them. Instead, it passes the raw date strings fromthis.fromDateandthis.untilDatedirectly tocreateOOORequest, which is the correct approach since the API expects date strings (the conversion to timestamps happens in the controller).Remove the unused parameter and dead code:
Proposed fix
At line 57 in
getCurrentStatusObj:- await this.updateStatusBasedOnMode(newStateObj); + await this.updateStatusBasedOnMode();Remove the unused timestamp methods or refactor if needed elsewhere. Delete or simplify lines 50-56 in
getCurrentStatusObjsince onlythis.reasonis ultimately needed.
📜 Review details
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
app/components/user-status-modal.jstests/integration/components/user-status-modal-test.js
🧰 Additional context used
🧬 Code graph analysis (1)
tests/integration/components/user-status-modal-test.js (1)
tests/unit/controllers/status-test.js (2)
until(135-137)until(180-182)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build (18.x)
🔇 Additional comments (1)
tests/integration/components/user-status-modal-test.js (1)
64-70: Test assertions correctly updated to expect date strings.The type assertions now correctly expect
fromanduntilto be strings instead of numeric timestamps, aligning with the production change. The YYYY-MM-DD date format used in the test is consistent with the backend utilitygetUTCMidnightTimestampFromDate, which explicitly parses dates in this format before converting them to UTC midnight timestamps.
* Feature flag removed : user OOO approve reject (#1110) * code changes OOO flow Migrated from users page to request flow * removed console log * changed assert.expect * fix: pass date strings instead of timestamps to createOOORequest * fixed errors * wrong commit fix * removed else * removed stateobj --------- Co-authored-by: Dhirenderchoudhary <dhirenderchoudhary0001@gmailcom> * fix: OOO migration date issues (#1112) * fixed date issues * fix lint --------- Co-authored-by: Dhirenderchoudhary <dhirenderchoudhary0001@gmailcom> * fix: Update OOO request button text (#1116) * message changed * message fix * lint fix --------- Co-authored-by: Dhirenderchoudhary <dhirenderchoudhary0001@gmailcom> --------- Co-authored-by: Dhirender Choudhary <[email protected]> Co-authored-by: Dhirenderchoudhary <dhirenderchoudhary0001@gmailcom>
Date:
1-01-2026Developer Name:
DhirenderIssue Ticket Number:-
#1109
Description:
The from and until fields were unnecessarily converted to UTC midnight values, which resulted in a mismatch with the backend API contract.
Changes:
• Removed unnecessary UTC date conversion.
• Ensured from and until are sent as numeric timestamps.
• Updated tests to validate correct data types and prevent regressions.
Is Under Feature Flag
Database changes
Breaking changes
Is Development Tested?
Tested in staging?
Screenshot below
Screen.Recording.2026-01-01.at.4.20.49.AM.mov