[Bug]: Custom sections parsed from an uploaded resume are silently missing from the editor and PDF
Describe the bug
When I upload a resume that contains non-standard sections (for example Publications or Volunteer Work), the parser correctly puts them into customSections, but no sectionMeta entries are created for them. The builder form and every resume template iterate sectionMeta, so these sections never appear in the editor, the preview, or the exported PDF. The data is still stored, so nothing tells the user that content was dropped.
A related problem affects API clients: SectionMeta.isDefault defaults to true, and the templates only render custom sections when isDefault is false. If I add a custom section's meta via PATCH /api/v1/resumes/{id} without explicitly sending "isDefault": false, it is stored as isDefault: true and still does not render.
Root cause (commit 9c05e42):
The parse prompt asks for
customSectionsbut never for their metadata.RESUME_SCHEMA_EXAMPLE(apps/backend/app/prompts/templates.py:21) includescustomSections(e.g.publications,volunteer_work) and nosectionMeta, andPARSE_RESUME_PROMPT(templates.py:162-164) instructs the model to put non-standard sections intocustomSections.parse_resume_to_json(apps/backend/app/services/parser.py:814-849) validates throughResumeData, wheresectionMetadefaults to[](apps/backend/app/schemas/models.py:421). The upload route stores that result as-is (apps/backend/app/routers/resumes.py:1041,1057-1062); the retry-processing route does the same (resumes.py:2190).On read,
normalize_resume_data(models.py:394-406) sees an emptysectionMetaand fills it withDEFAULT_SECTION_META(models.py:336-390), which only contains the six built-in sections. Nothing derives entries for existingcustomSectionskeys.GET /api/v1/resumesapplies this atresumes.py:1122-1123.The frontend does the same fallback:
getSectionMeta/getSortedSections(apps/frontend/lib/utils/section-helpers.ts:130-139) returnDEFAULT_SECTION_METAwhensectionMetais empty, and nothing reconcilescustomSectionskeys that have no meta.The builder form renders only sections present in
sectionMeta(apps/frontend/components/builder/resume-form.tsx:400-407). A meta entry withisDefault: trueand an unknown key falls through todefault: return null(resume-form.tsx:272-273), so the editor shows no content for it.All seven templates iterate
getSortedSections(data)and gate custom sections on!isDefault:resume-single-column.tsx:37,:254resume-modern.tsx:37,:254resume-clean.tsx:39,:262resume-latex.tsx:39,:258resume-two-column.tsx:55,:85resume-modern-two-column.tsx:61,:93resume-vivid.tsx:49,:76
(all under
apps/frontend/components/resume/). The print route used for PDF export (apps/frontend/app/print/resumes/[id]/page.tsx:180) passes data throughwithLocalizedDefaultSections, which applies the same built-ins-only fallback.SectionMeta.isDefaultdefaults toTrue(models.py:263), andPATCH /api/v1/resumes/{id}(resumes.py:1990-2010) storesResumeData.model_dump()without checking that value. Only the UI's "Add section" flow setsisDefault: false(section-helpers.ts:178).
The recent "duplicate entries and custom sections" changes (duplicateCustomSection in section-helpers.ts) only act on sections that already have meta, so they do not cover this case.
To Reproduce
A. Upload (UI)
- Configure any LLM provider and start the app on
main(9c05e42). - Upload a PDF/DOCX resume that has, besides Experience and Education, a "Publications" section and a "Volunteer Work" section.
- Wait for processing to finish and open the resume in the builder.
- The Publications and Volunteer Work sections are not shown in the form, the preview, or the downloaded PDF.
GET /api/v1/resumes?resume_id=<id>shows them inprocessed_resume.customSections, butprocessed_resume.sectionMetaonly lists the six built-in sections.
I reproduced this in-process with httpx.ASGITransport against app.main:app and an isolated data directory. I mocked parse_document and the LLM call (complete_json) to return a payload shaped exactly like RESUME_SCHEMA_EXAMPLE, so the real parse_resume_to_json validation, upload route, and GET normalization all ran:
UPLOAD 200 {... 'processing_status': 'ready', 'is_master': True, ...}
GET customSections keys: ['publications', 'volunteer_work']
GET sectionMeta keys: ['personalInfo', 'summary', 'workExperience', 'education', 'personalProjects', 'additional']
customSections keys WITHOUT sectionMeta: ['publications', 'volunteer_work']B. PATCH without isDefault (API)
RID=<resume_id>
curl -s "http://localhost:8000/api/v1/resumes?resume_id=$RID" \
| jq '.data.processed_resume
| .sectionMeta += [{"id":"publications","key":"publications",
"displayName":"Publications","sectionType":"itemList",
"isVisible":true,"order":6}]' \
> body.json
curl -s -X PATCH "http://localhost:8000/api/v1/resumes/$RID" \
-H 'Content-Type: application/json' --data @body.json \
| jq '.data.processed_resume.sectionMeta[] | select(.key=="publications")'Result:
{'id': 'publications', 'key': 'publications', 'displayName': 'Publications',
'sectionType': 'itemList', 'isDefault': True, 'isVisible': True, 'order': 6}The section is now in sectionMeta but is still not rendered by any template, and the builder shows it with an empty body.
Expected behavior
- Every non-empty key in
customSectionsthat comes from parsing an uploaded resume shows up in the builder, the preview, and the PDF, with a sensible display name (e.g. "Publications", "Volunteer Work") and thesectionTypefrom the parsed data. - A
sectionMetaentry whosekeyis not a built-in section is treated as a custom section (isDefault: false), or the API rejects it with a clear validation error instead of storing a section that can never render.
Suggested fix:
- In
normalize_resume_data(so it covers upload, retry, GET, and existing stored resumes), append aSectionMetafor eachcustomSectionskey that has none:idandkeyset to the key,displayNamederived from the key (volunteer_work→ "Volunteer Work"),sectionTypetaken from the custom section,isDefault: false,isVisible: true, andorderafter the current maximum. The same step is needed whensectionMetais non-empty but incomplete, not only when it is empty. - Make
isDefaultdepend on the key, e.g. aSectionMetavalidator that setsisDefault = key in BUILTIN_SECTION_KEYS, or at least default it toFalsefor keys that are not built-in. Otherwise, reject the inconsistent combination on PATCH. - Optionally, mirror the reconciliation in
getSectionMetaon the frontend so data that was already stored renders without a backend round-trip. - Optionally, have the parse prompt also return a human-readable title for each custom section so the display name is not guessed from the key.
Environment
- Resume Matcher
mainat commit9c05e42(after #1010) - Backend: Python / FastAPI (
apps/backend), any LLM provider (the parse output shape is set by the prompt, not by the provider) - OS / Browser: macOS; affects all browsers because the section list is derived from the data
Screenshots
N/A. The API output above shows the missing metadata.
Source: srbhr/Resume-Matcher