refactor: complete cleanup of console.error in dashboard pages#33
refactor: complete cleanup of console.error in dashboard pages#33aliyevr889 wants to merge 2 commits into
Conversation
hsperus
left a comment
There was a problem hiding this comment.
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.
0e02108 to
626e3d5
Compare
|
Summary of completed fixes: The PR is now ready for review. |
626e3d5 to
f998aec
Compare
cd53dda to
2465122
Compare
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.