Fix skill parsing for skill names containing commas#265
Conversation
|
@jwalkorat is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@jwalkorat kindly resolve the merge conflicts |
# Conflicts: # static/script.js
|
Hi @komalharshita , I have successfully resolved the merge conflicts. The branch is now up to date with the latest changes from main, and all local tests are passing. |
komalharshita
left a comment
There was a problem hiding this comment.
Thanks for the contribution — this PR addresses a real edge case and the overall implementation direction is solid.
The issue is correctly identified: comma-separated serialization breaks skill names containing commas, which can corrupt parsing behavior and recommendation input handling.
Switching to JSON-based serialization is a much cleaner and more scalable solution. I also appreciate that backward compatibility was considered through fallback parsing logic instead of introducing a hard breaking change.
What was done well
- Proper migration away from fragile comma-splitting
- Defensive malformed-JSON handling
- Consistent frontend/backend synchronization
- Backward compatibility support for older values
- Focused implementation scope without unnecessary refactors
Requested improvements before merge
-
Add automated tests for:
- valid JSON array parsing
- malformed JSON handling
- legacy comma-separated fallback parsing
- skill names containing commas
-
Briefly document the serialization format change for future contributors.
-
Please verify the duplicated conditional block visible in the diff:
if (skillsHidden) {
and ensure no accidental duplicate logic remains after final cleanup/rebase.
Since this touches shared recommendation-input logic, the full recommendation flow should also be manually tested before merge.
Overall, this is a meaningful robustness improvement and should be mergeable after the above refinements.
|
Hi @komalharshita , Thank you for the review and suggestions. I have addressed the requested changes:
Verification:
The branch is now updated and ready for re-review. Thanks again! |
komalharshita
left a comment
There was a problem hiding this comment.
Thank you for addressing the previous review feedback.
I re-reviewed the updated implementation and the overall solution looks solid.
What was improved:
- Replaced fragile comma-separated skill serialization with JSON-based serialization.
- Preserved backward compatibility through fallback parsing.
- Added automated tests for:
- valid JSON parsing
- malformed JSON handling
- legacy comma-separated parsing
- skill names containing commas
- Removed the duplicate frontend logic previously identified.
- Added documentation/comments explaining the serialization format.
This is a meaningful robustness improvement and the implementation remains focused on the original issue without introducing unnecessary scope.
The only remaining blocker is that the branch currently has merge conflicts that must be resolved before the PR can be merged.
Please resolve the conflicts, re-run the test suite, and push the updated branch.
Once the conflicts are resolved and CI passes, this PR looks good to merge.
Summary
Fixed a bug where skill names containing commas were parsed incorrectly.
Previously, skills were stored as comma-separated strings. This caused problems when a skill itself contained commas, such as
"HTML, CSS".This PR updates the frontend to send skills using
JSON.stringify()and updates the backend parser to safely reconstruct the original skill array usingjson.loads().A fallback for the previous comma-separated format was also added to maintain backward compatibility.
Related Issue
Closes #188
Type of Change
What Was Changed
static/script.jsJSON.stringify()utils/recommender.pyHow to Test This PR
Run the app:
python app.py
Open:
http://127.0.0.1:5000
Add a skill containing commas
Example:
HTML, CSS
Generate recommendations
Verify that:
Test Results
Tested manually in browser.
Self-Review Checklist
Notes for Reviewer
This implementation fixes the parsing issue without changing the overall recommendation architecture and keeps support for older comma-separated skill formats.