Skip to content

fix: remove unused imports, dead code block, and add fetch error guard in DeveloperEngagementDashboard#83

Open
Harshit-Mishra2212 wants to merge 1 commit into
seetadev:mainfrom
Harshit-Mishra2212:fix/dashboard-unused-imports-dead-code-fetch-guard
Open

fix: remove unused imports, dead code block, and add fetch error guard in DeveloperEngagementDashboard#83
Harshit-Mishra2212 wants to merge 1 commit into
seetadev:mainfrom
Harshit-Mishra2212:fix/dashboard-unused-imports-dead-code-fetch-guard

Conversation

@Harshit-Mishra2212

Copy link
Copy Markdown

Description

While going through DeveloperEngagementDashboard.tsx , found three issues in the same file — unused imports that bloat the client bundle, a guard block that can never execute, and a fetch call that doesn't check response.ok before parsing the response as data.

Fixes #54

Changes

  • Fix
  • Removed unused Papa, ParseResult, ParseConfig, ParseError, and Parser imports from papaparse — the CSV loading was switched to fetch + response.json() at some point but the import was never cleaned up
  • Removed unreachable if (!processedData && isLoading) guard block — the block above it already returns when processedData is falsy, so this block can never run. Also removed the now-unused LoadingSpinner import
  • Added response.ok check in loadCSVData before calling response.json() — without this, a 500 or 404 from /api/cohort silently gets treated as valid engagement data and passed through the entire processing pipeline

Screenshots / Demo

N/A - no visual change on the happy path. The fetch guard surfaces actual server errors instead of silently corrupting the data pipeline.

Additional Notes

All three changes are in src/components/dashboard/DeveloperEngagementDashboard.tsx only. No other files touched. The unreachable block was likely left over from an earlier refactor where the loading/error handling sequence was reorganised but the old guard wasn't removed.

Checklist

  • I have tested this code
  • [-] I have added necessary documentation
  • I have linked relevant issue(s)
  • I followed the code style of the project
  • I reviewed my own code

@vercel

vercel Bot commented May 15, 2026

Copy link
Copy Markdown

@Harshit-Mishra2212 is attempting to deploy a commit to the SEETA's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

Code Audit – Security, Maintainability, Performance

1 participant