fix(advanced-assessment): advanced assessment session timer#162
Conversation
|
Warning Review limit reached
More reviews will be available in 27 minutes and 23 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ 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 |
Description
Fixed advanced assessment session timer data so remaining_seconds no longer stays at ~90 minutes after an attempt is used. The backend now returns 0 once submit is queued (submit_enqueued_at) or scoring completes (completed_at), via shared resolveSessionTimerState() on GET session/:id, start responses, and LT-2 max_seconds_remaining.
Related Issue (Link to Github issue)
N/A
Motivation and Context
Motivation
After a user submitted an advanced assessment (or while it was being scored), the backend could still return remaining_seconds near 5400 (90 minutes) on GET session/:id and related responses. Timer fields were computed only from the original expires_at (start + 90 min), ignoring whether the attempt had been submitted or completed.
That made the UI show a live countdown even though the session was already used, which was confusing and inconsistent with the actual state of the assessment.
Context
Advanced assessment sessions expose timer data on session payloads. This was separate from the processing-lock fix (blocking duplicate starts with ADVANCED_SUBMIT_PROCESSING). That fix stopped new attempts; this one fixes timer data returned for an existing session.
How Has This Been Tested?
Unit tests cover queued-submit and completed sessions.
Screenshots (if appropriate - Postman, etc):
Types of changes
Checklist: