Skip to content

fix: return normalized lowercase name when contributor not found in alias map - #81

Open
Harshit-Mishra2212 wants to merge 1 commit into
seetadev:mainfrom
Harshit-Mishra2212:fix/normalize-contributor-name-casing
Open

Harshit-Mishra2212 wants to merge 1 commit into
seetadev:mainfrom
Harshit-Mishra2212:fix/normalize-contributor-name-casing

Conversation

@Harshit-Mishra2212

Copy link
Copy Markdown

Problem

normalizeContributorName() in src/lib/constants.ts lowercases the input into a variable called normalized to look up the alias map, but falls back to the original name (with its original casing) when no alias is found.

This means the same contributor can produce different return values depending on how their name was capitalized in Airtable:

  • normalizeContributorName('Prabhat') → 'Prabhat'
  • normalizeContributorName('prabhat') → 'prabhat'

These two values are not equal, so the same real person gets treated as two different contributors. More critically, the returned value is used in validateContributions() to match against GitHub issue assignee logins, which are always lowercase. A mixed-case return value will never match a GitHub login, causing real contributions to be marked as discrepancies.

Fixes #54


Changes

  • Fix
  • Changed || name to || normalized in normalizeContributorName() so it always returns the lowercased version when no alias is found

📷 Screenshots / Demo (if applicable)

N/A — logic fix. Behaviour before and after:

// Before
normalizeContributorName('Prabhat') → 'Prabhat'
normalizeContributorName('prabhat') → 'prabhat'
// same person, different values — breaks GitHub login matching

// After
normalizeContributorName('Prabhat') → 'prabhat'
normalizeContributorName('prabhat') → 'prabhat'
// consistent, alias lookups still work as before

Additional Notes

One word changed in src/lib/constants.ts, no other files touched. Alias lookups are completely unaffected since they return directly from the map before hitting the fallback.


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 14, 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.

This branch has not been deployed

No deployments
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