Fix Garbage Characters in Resume Parser - #8274
Conversation
…nt timeout on large repos
Fixes JhaSourav07#6096 by preserving valid UTF-8, avoiding faulty binary text fallbacks, and adding heuristic to repair misencoded artifacts.
|
@pisum-sativum is attempting to deploy a commit to the jhasourav07's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
This pull request resolves a critical issue with the resume parser by enhancing its ability to handle UTF-8 characters and removing unwanted artifacts. This aligns with our previous decisions on bug fixes aimed at improving code quality, such as the recent fix for dead code in the calculateStreak function. Thank you for your contribution, and I look forward to your updates! |
|
@JhaSourav07 I have done the necessary changes kindly check and merge with appropriate labels. |
…owing them Moves buffer header checks outside try/catch blocks so that failures in buffer.toString (e.g. in tests mocking the method) correctly propagate to callers. Only third-party parser failures (pdf-parse, mammoth) are silently caught. Fixes the failing error-resilience test.
📦 Next.js Bundle Size Report (Gzipped Sizes)✨ No significant bundle size changes detected. 📊 Summary of Totals
|
Aamod007
left a comment
There was a problem hiding this comment.
Thanks for fixing the resume parser encoding issue! Handling Latin-1 character mangling is a tricky bug, and the fallback parsing logic looks solid.
However, it looks like this PR accidentally includes some unrelated changes. You have modified files like \lib/github.ts, \services/github/ci-analytics.ts, and \�pp/generator/data/socials.ts, which don't seem related to the resume parsing fix.
Please revert the changes to those files so that the PR focuses solely on \lib/resume-parser.ts.
Looking forward to getting this merged once the branch is cleaned up!
Label Justification:
- \level:intermediate: Debugging and writing fixes for encoding issues and buffer parsing is an intermediate task.
- \ ype:bug: Fixes broken character rendering when parsing CV files.
- \mentor:Aamod007: Assigned as required.
|
🚨 Hey @pisum-sativum, the CI Pipeline is failing on this PR and it has been marked as Please fix the issues before this can be reviewed. Here's how: 1. Run checks locally before pushing: npm run format:check # Check Prettier formatting
npm run lint # Run ESLint
npm run typecheck # TypeScript type check
npm run test # Run unit tests (Vitest)
npm run build # Verify production build passes2. Auto-fix common issues: npm run format # Auto-fix formatting with Prettier
npm run lint -- --fix # Auto-fix lint errors where possible3. Check the full failure log here: Once you push a fix and the CI passes, the |
…bage-chars # Conflicts: # components/burnout/BurnoutRiskTable.tsx
…, and achievements types
…files to origin/main
@Aamod007 I have done the necessary changes required but the CI is failing again and again I tried to fix it but I don't think so I can. Maybe after sometime will try ;( |
…ypes to match origin/main
Aamod007
left a comment
There was a problem hiding this comment.
I see you've pushed new commits since my last review. The resume parser changes look good — the latin1 re-encoding fix (Buffer.from(rawText, 'latin1').toString('utf-8')) is a clean approach for handling garbage characters, and restructuring the PDF/DOCX error handling to avoid the double-UTF8 fallback bug is a solid improvement.
However, CI checks are still failing (Format · Lint · Typecheck · Test). Please take a look at the failure logs and push a fix so we can move forward.
Label justification:
- level:intermediate — spans 4 files with non-trivial parser logic changes and formatting fixes
- quality:clean — clean code structure
- type:bug — fixes actual rendering bugs in resume parsing
- mentor:Aamod007 — assigned
Aamod007
left a comment
There was a problem hiding this comment.
Re-reviewing: the only CI failure was Vercel authorization (not code-related). All code checks pass. The Vercel deploy auth is a repo-level config issue. Approving.
|
@Aamod007 @JhaSourav07 Kindly check and merge if possible with correct labels. |
|
@Aamod007 @JhaSourav07 Kindly merge this pr so that i can take up new issues since the bots is not allowing me to take up any more new issues . |
|
@Aamod007 @JhaSourav07 If no change is required then kindly check and merge. |
|
@Aamod007 @JhaSourav07 pls check and merge |
|
If you are still working on this, please push your latest changes or leave a comment to keep it active. |
Aamod007
left a comment
There was a problem hiding this comment.
Good catch on the parser fallback logic and UTF-8 handling! Ensuring that resume text is clean from encoding artifacts makes the dashboard experience much better for users. Note that there are some unrelated Prettier formatting changes in other files, but since they improve code formatting, it's fine. Approved!
|
@Aamod007 @JhaSourav07 Pls merge this pr asap |
|
@Aamod007 @JhaSourav07 pls merge this pr asap |
|
@JhaSourav07 could you please merge all the PRs I've worked on? I've been requesting this for several days now but they are still pending. I would really appreciate it if you could review and merge them as soon as possible. Thank you! |
|
If you are still working on this, please push your latest changes or leave a comment to keep it active. |
|
@JhaSourav07 pls merge |
|
@JhaSourav07 Any update? |
|
If you are still working on this, please push your latest changes or leave a comment to keep it active. |
2 similar comments
|
If you are still working on this, please push your latest changes or leave a comment to keep it active. |
|
If you are still working on this, please push your latest changes or leave a comment to keep it active. |
|
If you are still working on this, please push your latest changes or leave a comment to keep it active. |



Description
Fixes #6096
This PR resolves an issue with the resume parsing engine where valid UTF-8 characters were aggressively stripped out while misencoded garbage characters and decoding artifacts (such as
é,\uFFFD) polluted the extracted text.Key changes include:
Pillar
Visual Preview
(Not applicable as this is a backend parser fix, but the dashboard preview will no longer contain garbage formatting artifacts.)
Checklist before requesting a review:
CONTRIBUTING.mdfile.localhost:3000/api/streak?user=YOUR_USERNAME).npm run formatandnpm run lintlocally and resolved all errors (CI will fail otherwise).feat(themes): ...,fix(calculate): ...).README.mdif I added a new theme or URL parameter.