fix: sanitize social URLs by stripping leading @ symbols and correctl… - #6582
Conversation
|
Someone is attempting to deploy a commit to the jhasourav07's projects Team on Vercel. A member of the Team first needs to authorize it. |
📦 Next.js Bundle Size Report (Gzipped Sizes)
📊 Summary of Totals
|
Aamod007
left a comment
There was a problem hiding this comment.
Hey there! Thanks for fixing the social URL sanitization. Handling leading @ symbols correctly will definitely improve the UX when adding social links.
For the labels: I'm assigning level:beginner because the change primarily involves string manipulation in the resolveSocialUrl helper. I'm adding quality:clean for the clean implementation and test coverage. The bug and feature labels are added as this fixes incorrect URL generation.
Unfortunately, the Vercel build check is failing. Please take a look at the Vercel logs to resolve the issue so we can get this merged!
284f1ae to
f6111b6
Compare
|
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.
Hey! Thanks for pushing updates to address the feedback. Unfortunately, it looks like this PR is currently blocked (due to failing CI checks, merge conflicts, etc.). We can't approve or proceed with the review until the build is green. Please resolve these issues, and let me know if you need any help debugging!
Aamod007
left a comment
There was a problem hiding this comment.
Re-reviewing: We are ignoring the Vercel/CI failures as per the latest update. Your code changes look solid. Approving!
Aamod007
left a comment
There was a problem hiding this comment.
Sanitizing social URLs by stripping leading @ symbols in validations.ts cleanly fixes user input errors. However, the CI checks are failing. Please resolve the issues and rerun the CI pipeline.
Aamod007
left a comment
There was a problem hiding this comment.
Upon re-evaluation, I realized I previously misinterpreted the Vercel deployment failure as an issue with this PR. The Vercel build failure seems unrelated to the changes introduced here, so I will ignore it moving forward. The rest of the PR looks good, so I'm approving it!
Aamod007
left a comment
There was a problem hiding this comment.
This is an excellent refactoring! Extracting the URL resolution into a centralized function and providing full test coverage is the right way to handle this issue. Great job!
However, your branch currently has merge conflicts with the \main\ branch (indicated by the
eeds-rebase\ label). Please rebase your branch on the latest \main\ to resolve these conflicts.
Once the conflicts are resolved, we can get this merged!
Label Justification:
- \level:intermediate: Refactoring core logic into a reusable utility and writing a dedicated unit test suite makes this an intermediate contribution.
- \quality:clean: The code is well-structured and thoroughly tested.
- \ ype:bug\ & \ ype:refactor: Fixes broken URLs by refactoring the resolution logic.
- \mentor:Aamod007: Assigned as required.
…y concatenating with baseUrl
be99847 to
48a4736
Compare
Aamod007
left a comment
There was a problem hiding this comment.
Thanks for resolving the merge conflicts and getting this rebased on \main! The refactoring and test coverage here is excellent.
Approving this PR! (Note: The \gssoc:needs-rebase\ label has been removed since conflicts are resolved.)
Label Justification:
- \level:intermediate: Refactoring core logic into a reusable utility and writing a dedicated unit test suite.
- \quality:clean: Well-structured code and thoroughly tested.
- \ ype:bug, \ ype:refactor, \ ype:feature: Fixes broken URLs, extracts resolution logic, and improves URL handling.
- \mentor:Aamod007: Assigned as required.
|
🚨 Hey @desireddymohithreddy0925, 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 |
Aamod007
left a comment
There was a problem hiding this comment.
This PR was approved but currently has failing CI checks. Please resolve the CI failures before merging.
Aamod007
left a comment
There was a problem hiding this comment.
Update: the CI failure is Vercel authorization only (not code-related). All actual code checks pass. The original approval stands — Vercel deploy auth is a repo config issue.
Fixes #6499
Description
This PR fixes a bug where social platforms with base URLs ending in
@(such as TikTok, YouTube, Medium) generated invalid profile links with duplicated@@symbols if users manually included the@symbol in their handles. AresolveSocialUrlhelper was introduced to safely normalize social link inputs before URL construction. The logic intelligently strips leading@symbols if thebaseUrlalready includes it and defaults to using the raw user input if they typed an absolutehttp(s)://URL. The helper was applied to both the README generator logic and the live frontend link preview component. Unit tests forresolveSocialUrlhave been added to verify these behaviors.Checklist before requesting a review:
npm run formatandnpm run lintlocally and resolved all errors.