Skip to content

refactor: complete cleanup of console.error in dashboard pages#33

Open
aliyevr889 wants to merge 2 commits into
Hesper-Labs:mainfrom
aliyevr889:fix-console-errors
Open

refactor: complete cleanup of console.error in dashboard pages#33
aliyevr889 wants to merge 2 commits into
Hesper-Labs:mainfrom
aliyevr889:fix-console-errors

Conversation

@aliyevr889
Copy link
Copy Markdown

This PR finishes the work of removing redundant console.error calls in dashboard pages (Automation, Customers, SLA, Knowledge, Canned Responses, etc.) which were missed previously. All error feedback is now consistently managed via user-facing toast notifications.
Note: System loggers and the global ErrorBoundary were intentionally left unchanged.

hsperus

This comment was marked as duplicate.

Copy link
Copy Markdown
Collaborator

@hsperus hsperus left a comment

Choose a reason for hiding this comment

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

Hey Aslan, I went through the PR. The goal makes sense, replacing console.error with toast notifications is a good UX improvement. But there are some serious issues that need to be fixed before we can merge this.

In several files the toast calls are incomplete. automation/page.tsx, business-hours/page.tsx, canned-responses/page.tsx, knowledge/page.tsx and sla/page.tsx all have toast objects missing their closing }); and the description field. This will cause syntax errors because the } gets mixed up with the finally block. I counted roughly 23 places with this problem.

There's also an indentation issue in customers/page.tsx. The catch blocks are shifted one level deeper than they should be, so they don't align with their try blocks. This will break compilation as well.

Another important thing is error traceability. console.error has been removed everywhere but nothing replaced it for logging purposes. The actual error object including the stack trace is just gone now. When something fails in production it'll be very hard to debug. The ErrorBoundary file actually does it the right way, it keeps both the toast and console.error together. I'd recommend doing the same in all the other files. Show the toast for the user, keep console.error for the developers.

The commit history is also a bit messy with 10 commits carrying almost the same message. A squash before merge would clean that up nicely.

To summarize: please complete the missing toast closings and description fields, fix the indentation in customers/page.tsx, and keep console.error alongside the toasts instead of removing it entirely. Happy to take another look once those are addressed.

@aliyevr889 aliyevr889 force-pushed the fix-console-errors branch from 0e02108 to 626e3d5 Compare April 9, 2026 08:42
@aliyevr889
Copy link
Copy Markdown
Author

Summary of completed fixes:
(1) Fixed truncated toast notifications (added missing descriptions and closing syntax).
(2) Corrected indentation issues in customers/page.tsx.
(3) Restored console.error logging in all catch blocks for better developer traceability.
(4) Squashed all commits into a single clean commit as requested.

The PR is now ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants