Skip to content

Comments

Fix: Admin redirected to test steps on refresh and after step completion in moderated sessions#1676

Open
rakshityadav1868 wants to merge 1 commit intoruxailab:developfrom
rakshityadav1868:fix-redirect-on-refresh
Open

Fix: Admin redirected to test steps on refresh and after step completion in moderated sessions#1676
rakshityadav1868 wants to merge 1 commit intoruxailab:developfrom
rakshityadav1868:fix-redirect-on-refresh

Conversation

@rakshityadav1868
Copy link
Contributor

Admin was being redirected to test steps during refresh. Fixed Firebase listener to keep admin always in video call during active session.

Changes:

  • Added condition in Firebase listener to ensure displayVideoCallComponent = true for admin throughout session
  • Admin never sees test step components (ConsentStep, PreTestStep, TaskStep, etc.)

File Modified:

  • src/ux/UserTest/views/ModeratedTestView.vue

BEFORE:

Screen.Recording.2026-02-13.at.12.29.14.AM.mp4

AFTER:

Screen.Recording.2026-02-13.at.12.30.33.AM.mp4

…n should directly redirect to opeen room

Signed-off-by: Rakshit Yadav <yadavrakshit60@gmail.com>
Copilot AI review requested due to automatic review settings February 12, 2026 19:16
@github-actions
Copy link

⚠️ PR Description Issues Detected

Please update the PR description to address these issues.

@sonarqubecloud
Copy link

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 showVideoCall for admins).
  • Updates step-advance logic to increment globalIndex when 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.

Comment on lines +790 to 794
// Increment globalIndex before updating Firebase
globalIndex.value = globalIndex.value + 1

const roomRef = dbRef(database, `rooms/${roomId.value}`)
await update(roomRef, {
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
@DivyanshuVortex
Copy link
Contributor

DivyanshuVortex commented Feb 12, 2026

@rakshityadav1868
Thanks for catching this.

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.

@github-actions github-actions bot added stale and removed stale labels Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants