Skip to content

fix: remove var redeclaration in syncSkillsHiddenInput to prevent variable shadowing - #617

Merged
komalharshita merged 3 commits into
komalharshita:mainfrom
akhilmodi29:fix/skills-hidden-input-shadowing
Jun 8, 2026
Merged

fix: remove var redeclaration in syncSkillsHiddenInput to prevent variable shadowing#617
komalharshita merged 3 commits into
komalharshita:mainfrom
akhilmodi29:fix/skills-hidden-input-shadowing

Conversation

@akhilmodi29

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes a variable shadowing bug in syncSkillsHiddenInput() where skillsHidden was being re-declared with var inside an if block, potentially causing selected skills to not be passed correctly to the recommendation API.

Changes Made

  • Removed var keyword from inside the if block in syncSkillsHiddenInput() in static/script.js
  • The outer skillsHidden variable is now correctly updated instead of a new local variable being created

Type of Change

  • Bug fix

Testing

  • Tested locally with python app.py
  • Added skills via text input and quick-pick chips
  • Skills correctly passed to API on form submission
  • No existing functionality broken

Related Issue

Closes #616

@vercel

vercel Bot commented May 26, 2026

Copy link
Copy Markdown

@akhilmodi29 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.

@akhilmodi29

Copy link
Copy Markdown
Contributor Author

@komalharshita Please review this PR and add the required labels including gssoc:approved. This fixes the variable shadowing bug in syncSkillsHiddenInput — the hidden skills input is now correctly updated, ensuring selected skills are properly passed to the recommendation API.
Labels suggested:

level:intermediate
type:bug
quality:clean

@akhilmodi29

Copy link
Copy Markdown
Contributor Author

@komalharshita Please review and merge with appropriate labels including gssoc: approved

@akhilmodi29

Copy link
Copy Markdown
Contributor Author

@komalharshita Please Review and merge with all appropriate labels including gssoc: approved

@akhilmodi29

Copy link
Copy Markdown
Contributor Author

@komalharshita Please Review and merge with all appropriate labels including gssoc: approved

@komalharshita komalharshita left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to merge!

@komalharshita
komalharshita merged commit 33e577f into komalharshita:main Jun 8, 2026
4 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Variable shadowing in syncSkillsHiddenInput causes skills hidden input to not update correctly

2 participants