fix: remove debug leftovers and dead code patterns from production#1857
fix: remove debug leftovers and dead code patterns from production#1857KishoreMuruganantham wants to merge 2 commits intoruxailab:masterfrom
Conversation
… 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>
|
There was a problem hiding this comment.
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.logstatements (including in performance-sensitive UI paths) and a debug-onlywatch(). - 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.
| 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') |
There was a problem hiding this comment.
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.
| ...(state.wcagData && { | ||
| ruleTitle: findRuleTitle(ruleId, state.wcagData), | ||
| principle: findPrincipleForRule(ruleId, state.wcagData), | ||
| guideline: findGuidelineForRule(ruleId, state.wcogData), |
There was a problem hiding this comment.
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.
| guideline: findGuidelineForRule(ruleId, state.wcogData), | |
| guideline: findGuidelineForRule(ruleId, state.wcagData), |
| ...(state.wcagData && { | ||
| ruleTitle: findRuleTitle(ruleId, state.wcagData), | ||
| principle: findPrincipleForRule(ruleId, state.wcagData), | ||
| guideline: findGuidelineForRule(ruleId, state.wcogData), |
There was a problem hiding this comment.
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.
| guideline: findGuidelineForRule(ruleId, state.wcogData), | |
| guideline: findGuidelineForRule(ruleId, state.wcagData), |
| 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), | ||
| ) |
There was a problem hiding this comment.
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.
| 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), | |
| ) |



Summary
console.logstatements across 12 component/view files (including performance-critical ones likeEyeTrackingOverlay.vueanimation loop)catch(e) { throw e }blocks across 9 files (StudyController.js,UserController.js,AuthController.js,Assessment.js, etc.)else {}blocks inUserTestView.vue,HeuristicsTable.vue, andUserController.jswatch()inTaskDetailsModal.vuethat served no purpose other than loggingconsole.log(tasksArray.value)inSusAnalytics.vuethat executed on every renderNo logic changes — only cleanup of debug leftovers and dead code.
Closes #1835
Files changed (22)
SusAnalytics.vue,TaskDetailsModal.vue,EyeTrackingOverlay.vue,VideoCall.vue,VideoRecorder.vue,UserTestView.vue,ModeratedTestView.vue,UserModeratedSentiment.vue,AudioWave.vue,EyeTrackingStats.vue,TaskStep.vue,CreateInviteDialog.vueStudyController.js,UserController.js,AuthController.js,FirebaseFirestoreRepository.js,Assessment.js,useProfile.js,CooperatorsView.vue,Auth.js,User.jsUserTestView.vue,HeuristicsTable.vue,UserController.jsTest plan
EyeTrackingOverlayrenders correctly without debug logs in animation loopSusAnalyticspage loads without top-level console output