Skip to content

fix: remove debug leftovers and dead code patterns from production#1857

Open
KishoreMuruganantham wants to merge 2 commits intoruxailab:masterfrom
KishoreMuruganantham:fix/remove-debug-leftovers-1835
Open

fix: remove debug leftovers and dead code patterns from production#1857
KishoreMuruganantham wants to merge 2 commits intoruxailab:masterfrom
KishoreMuruganantham:fix/remove-debug-leftovers-1835

Conversation

@KishoreMuruganantham
Copy link

Summary

  • Remove ~30 console.log statements across 12 component/view files (including performance-critical ones like EyeTrackingOverlay.vue animation loop)
  • Remove 19 no-op catch(e) { throw e } blocks across 9 files (StudyController.js, UserController.js, AuthController.js, Assessment.js, etc.)
  • Remove 3 empty else {} blocks in UserTestView.vue, HeuristicsTable.vue, and UserController.js
  • Remove a debug-only watch() in TaskDetailsModal.vue that served no purpose other than logging
  • Remove top-level console.log(tasksArray.value) in SusAnalytics.vue that executed on every render

No logic changes — only cleanup of debug leftovers and dead code.

Closes #1835

console-clean

Files changed (22)

Category Files
console.log removal SusAnalytics.vue, TaskDetailsModal.vue, EyeTrackingOverlay.vue, VideoCall.vue, VideoRecorder.vue, UserTestView.vue, ModeratedTestView.vue, UserModeratedSentiment.vue, AudioWave.vue, EyeTrackingStats.vue, TaskStep.vue, CreateInviteDialog.vue
catch-rethrow removal StudyController.js, UserController.js, AuthController.js, FirebaseFirestoreRepository.js, Assessment.js, useProfile.js, CooperatorsView.vue, Auth.js, User.js
empty else removal UserTestView.vue, HeuristicsTable.vue, UserController.js

Test plan

  • Verify browser console is clean of debug output on all affected pages
  • Verify error propagation still works correctly (errors bubble up naturally without catch-rethrow)
  • Verify EyeTrackingOverlay renders correctly without debug logs in animation loop
  • Verify SusAnalytics page loads without top-level console output

Kishore M and others added 2 commits March 10, 2026 16:06
… else blocks

Remove ~30 console.log statements, 19 catch(e) { throw e } no-op blocks,
and 3 empty else {} blocks across 22 files. These debug leftovers leaked
internal data to the browser console in production, added noise to stack
traces, and included dead code paths.

Closes ruxailab#1835

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 10, 2026 10:41
@github-actions github-actions bot added accessibility Issues related to accessibility method assets fix heuristic high-complexity size/L ui/ux user-test Issues related to user test labels Mar 10, 2026
@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 cleans up production-facing debug leftovers by removing console.log usage, no-op catch (e) { throw e } blocks, and other dead-code patterns across UI components and controller/store code paths.

Changes:

  • Removed debug console.log statements (including in performance-sensitive UI paths) and a debug-only watch().
  • Removed no-op catch/rethrow blocks to reduce noise and simplify error propagation.
  • Removed empty else {} blocks.

Reviewed changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/ux/accessibility/store/Assessment.js Removes catch/rethrow wrappers in store actions (reveals a couple of existing auth/WCAG data reference bugs to fix).
src/ux/UserTest/views/UserTestView.vue Removes debug logs and an empty else branch.
src/ux/UserTest/views/ModeratedTestView.vue Removes debug logging around task/timer handling.
src/ux/UserTest/components/steps/TaskStep.vue Removes debug logging on timer stop emit.
src/ux/UserTest/components/sessions/EyeTrackingStats.vue Removes debug log during mount.
src/ux/UserTest/components/sentimentAnalysis/UserModeratedSentiment.vue Removes debug logs around sentiment analysis.
src/ux/UserTest/components/sentimentAnalysis/AudioWave.vue Removes debug log when playing audio segments.
src/ux/UserTest/components/dialogs/CreateInviteDialog.vue Removes debug logging for datetime construction.
src/ux/UserTest/components/answers/EyeTrackingOverlay.vue Removes frequent debug logging in overlay render/seek logic.
src/ux/UserTest/components/VideoRecorder.vue Removes debug logging around recording/upload and task indexing.
src/ux/UserTest/components/VideoCall.vue Removes debug logs in WebRTC signaling/media init.
src/ux/UserTest/components/UnmoderatedTestAnalytics/TaskDetailsModal.vue Removes debug-only watch() that logged prop updates.
src/ux/UserTest/components/UnmoderatedTestAnalytics/SusAnalytics.vue Removes top-level computed value logging on render.
src/ux/Heuristic/components/HeuristicsTable.vue Removes empty else branch.
src/shared/views/CooperatorsView.vue Removes catch/rethrow wrapper around store dispatch.
src/features/super/store/User.js Removes no-op catch/rethrow in delete flow while retaining finally.
src/features/auth/store/Auth.js Removes no-op catch/rethrow in deleteAuth while retaining finally.
src/features/auth/controllers/UserController.js Removes catch/rethrow wrappers in controller methods.
src/features/auth/controllers/AuthController.js Removes catch/rethrow wrapper around axios call.
src/features/auth/composables/useProfile.js Removes catch/rethrow wrapper in profile image upload helper.
src/controllers/StudyController.js Removes catch/rethrow wrappers; keeps delete flow logic intact (but has an inefficiency to address).
src/app/plugins/firebase/FirebaseFirestoreRepository.js Removes catch/rethrow wrapper in update() helper.
src/assets/images/console-clean.png Adds screenshot asset referenced by the PR description.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 583 to +588
async resetAssessment({ commit, rootState }, { testId }) {
try {
const userId = rootState.auth.user?.uid
if (userId && testId) {
await assessmentController.deleteAssessment(userId, testId)
}
commit('RESET_ASSESSMENT')
} catch (error) {
throw error
const userId = rootState.auth.user?.uid
if (userId && testId) {
await assessmentController.deleteAssessment(userId, testId)
}
commit('RESET_ASSESSMENT')
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

In resetAssessment, rootState.auth does not match the Vuex module name used elsewhere (Auth). As written, userId will always be undefined and deleteAssessment will never run. Use rootState.Auth.user?.id (consistent with fetchConfigData and store/index.js) or otherwise align with the actual Auth module state shape.

Copilot uses AI. Check for mistakes.
...(state.wcagData && {
ruleTitle: findRuleTitle(ruleId, state.wcagData),
principle: findPrincipleForRule(ruleId, state.wcagData),
guideline: findGuidelineForRule(ruleId, state.wcogData),
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

saveAssessment builds metadata using state.wcogData, but the store state only defines wcagData (and the helper findGuidelineForRule expects WCAG data). This typo will result in missing/empty guideline values. Replace state.wcogData with state.wcagData.

Suggested change
guideline: findGuidelineForRule(ruleId, state.wcogData),
guideline: findGuidelineForRule(ruleId, state.wcagData),

Copilot uses AI. Check for mistakes.
...(state.wcagData && {
ruleTitle: findRuleTitle(ruleId, state.wcagData),
principle: findPrincipleForRule(ruleId, state.wcagData),
guideline: findGuidelineForRule(ruleId, state.wcogData),
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

Same state.wcogData typo appears in updateRuleAssessment when populating the guideline metadata. Since wcogData isn't defined in state, this will always be undefined. Use state.wcagData here as well.

Suggested change
guideline: findGuidelineForRule(ruleId, state.wcogData),
guideline: findGuidelineForRule(ruleId, state.wcagData),

Copilot uses AI. Check for mistakes.
Comment on lines +52 to +59
for (const cooperator of cooperators) {
// Add the call to remove notifications for the test being deleted
promises.push(
userController.removeTestFromUser(cooperator.userDocId, payload.id),
)
promises.push(
userController.removeNotificationsForTest(payload.id, cooperators),
)
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

deleteStudy adds removeNotificationsForTest(payload.id, cooperators) to the promises array inside a loop over cooperators, but removeNotificationsForTest itself loops over all cooperators. This results in O(n^2) reads/updates and may perform redundant writes. Call removeNotificationsForTest once (outside the loop) and only loop to call removeTestFromUser per cooperator.

Suggested change
for (const cooperator of cooperators) {
// Add the call to remove notifications for the test being deleted
promises.push(
userController.removeTestFromUser(cooperator.userDocId, payload.id),
)
promises.push(
userController.removeNotificationsForTest(payload.id, cooperators),
)
// Remove notifications for the test being deleted (once per test)
promises.push(
userController.removeNotificationsForTest(payload.id, cooperators),
)
// Remove the test from each cooperator's user document
for (const cooperator of cooperators) {
promises.push(
userController.removeTestFromUser(cooperator.userDocId, payload.id),
)

Copilot uses AI. Check for mistakes.
@github-actions github-actions bot added the stale label Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants