Fix: Admin redirected to test steps on refresh and after step completion in moderated sessions#1676
Conversation
…n should directly redirect to opeen room Signed-off-by: Rakshit Yadav <yadavrakshit60@gmail.com>
Please update the PR description to address these issues. |
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a moderated-session UX issue where the test admin could be redirected into participant test steps (especially on refresh or after step transitions), by adjusting the Firebase room listener behavior so admins remain in the video call UI throughout the session.
Changes:
- Ensures the admin always renders the video call component during an active room session (ignoring
showVideoCallfor admins). - Updates step-advance logic to increment
globalIndexwhen the moderator triggers “Proceed to Next Step”. - Minor formatting tweaks around timeout cleanup.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Increment globalIndex before updating Firebase | ||
| globalIndex.value = globalIndex.value + 1 | ||
|
|
||
| const roomRef = dbRef(database, `rooms/${roomId.value}`) | ||
| await update(roomRef, { |
There was a problem hiding this comment.
proceedToNextStep increments globalIndex optimistically (globalIndex.value = globalIndex.value + 1) before the Firebase update. This can (a) leave local state ahead of Firebase if the update fails, and (b) produce an out-of-range step (e.g., 6→7) which won’t render any step component for participants. Consider computing a nextGlobalIndex with a null/type guard and an upper bound (max step), updating Firebase with that value, and only then assigning it locally (or rolling back on failure).
|
@rakshityadav1868 It was fixed earlier, but I missed it during the refactoring — that’s on me. I’ve tested the changes locally and it’s working well. Appreciate you pointing it out. |



Admin was being redirected to test steps during refresh. Fixed Firebase listener to keep admin always in video call during active session.
Changes:
displayVideoCallComponent = truefor admin throughout sessionFile Modified:
src/ux/UserTest/views/ModeratedTestView.vueBEFORE:
Screen.Recording.2026-02-13.at.12.29.14.AM.mp4
AFTER:
Screen.Recording.2026-02-13.at.12.30.33.AM.mp4