fix: remove void operators and unnecessary awaits (SonarCloud)#386
fix: remove void operators and unnecessary awaits (SonarCloud)#386BillChirico merged 1 commit intomainfrom
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
|
🚅 Deployed to the volvox-bot-pr-386 environment in volvox-bot
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (9)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
🧰 Additional context used📓 Path-based instructions (4)**/*.{js,ts,tsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
web/src/**/*.{ts,tsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
web/src/app/dashboard/**/*.tsx📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/*.{js,ts,jsx,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (10)📚 Learning: 2026-03-26T00:04:14.673ZApplied to files:
📚 Learning: 2026-03-11T06:42:38.728ZApplied to files:
📚 Learning: 2026-03-10T23:21:49.730ZApplied to files:
📚 Learning: 2026-03-12T02:03:36.493ZApplied to files:
📚 Learning: 2026-03-10T23:21:49.730ZApplied to files:
📚 Learning: 2026-03-11T06:42:38.728ZApplied to files:
📚 Learning: 2026-03-26T00:04:14.673ZApplied to files:
📚 Learning: 2026-03-12T02:03:36.493ZApplied to files:
📚 Learning: 2026-03-11T05:32:46.325ZApplied to files:
📚 Learning: 2026-03-11T06:42:38.728ZApplied to files:
🔇 Additional comments (11)
📝 WalkthroughSummary by CodeRabbit
WalkthroughRemoved Changes
Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
There was a problem hiding this comment.
Pull request overview
This PR targets SonarCloud findings in the Next.js dashboard by removing void operators (and related unnecessary async “fire-and-forget” patterns) from several client components, primarily around useEffect/useCallback fetch flows.
Changes:
- Replaced
void someAsyncCall()withsomeAsyncCall()in multiple dashboard pages/components to address SonarCloud issues. - Updated interval callbacks and click handlers to call refresh/fetch functions without the
voidoperator.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| web/src/components/dashboard/performance-dashboard.tsx | Removes void usage for initial fetch, auto-refresh interval, refresh button, and post-save refresh call. |
| web/src/components/dashboard/health-section.tsx | Removes void usage from initial fetch, auto-refresh interval, and refresh/try-again buttons. |
| web/src/app/dashboard/tickets/tickets-client.tsx | Removes void usage when fetching stats and ticket list (effects + refresh). |
| web/src/app/dashboard/tickets/[ticketId]/page.tsx | Removes void usage from the detail fetch effect. |
| web/src/app/dashboard/temp-roles/page.tsx | Removes void usage from list fetches and refresh after revoke. |
| web/src/app/dashboard/members/members-client.tsx | Removes void usage around runFetch calls for list updates, load more, and refresh. |
| web/src/app/dashboard/conversations/conversations-client.tsx | Removes void usage around conversation list fetch calls in effect + refresh. |
| web/src/app/dashboard/conversations/[conversationId]/page.tsx | Removes void usage from the detail fetch effect. |
| web/src/app/dashboard/audit-log/page.tsx | Removes void usage around audit log fetch calls in effect + refresh. |
| useEffect(() => { | ||
| void fetchData(); | ||
| fetchData(); | ||
| return () => abortRef.current?.abort(); |
There was a problem hiding this comment.
This PR claims to remove void operator usage in the dashboard, but this file still contains onClick={() => void saveThresholds()} (around line 548). If the goal is to resolve SonarCloud findings consistently, update this remaining call site too (or adjust the PR description/scope).
| useEffect(() => { | ||
| if (!guildId) return; | ||
| void fetchConversations({ | ||
| fetchConversations({ | ||
| guildId, | ||
| search: debouncedSearch, |
There was a problem hiding this comment.
This PR description indicates void operators were removed from dashboard components, but this file still has void (async () => { ... })() in the channels-fetch effect (around line 176). Consider removing that remaining void usage as well (or clarify why it’s intentionally kept) to avoid leaving SonarCloud issues behind.
|
| Filename | Overview |
|---|---|
| web/src/app/dashboard/audit-log/page.tsx | Removed void from two fetchAuditLog fire-and-forget calls; function has a full try/catch, so change is safe. |
| web/src/app/dashboard/conversations/[conversationId]/page.tsx | Removed void from fetchDetail() call in useEffect; fetchDetail catches all errors internally. |
| web/src/app/dashboard/conversations/conversations-client.tsx | Removed void from two fetchConversations calls; fetchConversations has proper try/catch with abort-error guard. |
| web/src/app/dashboard/members/members-client.tsx | Removed void from three runFetch calls; runFetch delegates to fetchMembers in the Zustand store, which always resolves (never throws). |
| web/src/app/dashboard/temp-roles/page.tsx | Removed void from three fetchTempRoles calls across useEffect, handleRevoke, and handleRefresh; function has try/catch. |
| web/src/app/dashboard/tickets/[ticketId]/page.tsx | Removed void from fetchDetail() in useEffect; fetchDetail has comprehensive try/catch error handling. |
| web/src/app/dashboard/tickets/tickets-client.tsx | Removed void from four calls (fetchStats and fetchTickets); both functions absorb all errors internally. |
| web/src/components/dashboard/health-section.tsx | Removed void from four fetchHealth call sites (initial load, interval, two button handlers); function catches all errors including AbortError. |
| web/src/components/dashboard/performance-dashboard.tsx | Removed void from five fetchData call sites, but one void saveThresholds() in the button's onClick handler (line 548) was not updated, leaving an inconsistency with the rest of the PR. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["useEffect / useCallback / onClick"] -->|"before: void fn()"| B["Promise discarded\n(void → undefined)"]
A -->|"after: fn()"| C["Promise still floating\n(functionally identical)"]
B --> D["Internal try/catch\nin async fn"]
C --> D
D -->|success| E["setState(data)"]
D -->|error| F["setState(errorMsg)"]
D -->|AbortError| G["return early (no-op)"]
Prompt To Fix All With AI
This is a comment left during a code review.
Path: web/src/components/dashboard/performance-dashboard.tsx
Line: 548
Comment:
**Leftover `void` not removed by this PR**
This `onClick` handler still uses the `void` operator on `saveThresholds()`, while all analogous event handlers in this same file (e.g. `onClick={() => fetchData()}` on lines 274 and 289) were updated. If the goal is to fully resolve the SonarCloud `void` operator warnings, this call should be updated for consistency.
The `saveThresholds` function has a proper try/catch internally, so directly passing it as the handler is safe:
```suggestion
<Button onClick={saveThresholds} disabled={thresholdSaving}>
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix: remove void operators and unnecessa..." | Re-trigger Greptile



Fixes ~25 SonarCloud critical issues by removing
voidoperator usage from React dashboard components.Changes
Fix 1: Remove
voidoperator from web dashboard filesReplaced
void someFunc()with justsomeFunc()in fire-and-forget async calls insideuseEffectanduseCallbackhooks:conversations-client.tsxmembers-client.tsxtickets-client.tsxtemp-roles/page.tsxperformance-dashboard.tsxhealth-section.tsxaudit-log/page.tsxtickets/[ticketId]/page.tsxconversations/[conversationId]/page.tsxTest Results