Skip to content

Refactor third-party integrations to use a shared HTTP client#171

Merged
SamXop123 merged 1 commit into
SamXop123:mainfrom
vraj826:refactor/shared-http-client
Jun 9, 2026
Merged

Refactor third-party integrations to use a shared HTTP client#171
SamXop123 merged 1 commit into
SamXop123:mainfrom
vraj826:refactor/shared-http-client

Conversation

@vraj826

@vraj826 vraj826 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Description

Introduced a shared HTTP client and refactored all third-party integrations to use a common request layer. This centralizes timeout handling, response validation, JSON parsing, and error normalization while preserving existing fallback behavior.

Related Issue

Closes #163

Type of Change

  • Refactor
  • Performance improvement

Changes Made

  • Added a shared HTTP client (src/utils/http-client.js) for external API communication
  • Refactored GitHub REST, GitHub GraphQL, LeetCode, Codeforces, and CodeChef services to use the shared client
  • Centralized timeout handling, JSON parsing, status validation, user-agent headers, and structured error normalization
  • Added unit tests for the HTTP client and integration-level service behavior
  • Preserved existing graceful degradation and fallback logic for optional integrations

Testing

  • Ran npm test — all tests pass
  • Tested manually (if applicable)

Verification performed:

  • npm.cmd run lint → passing
  • npm.cmd run test:unit → passing (12 suites, 141 tests)

Screenshots (if applicable)

N/A

Checklist

  • My code follows the project's code style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings or errors
  • I have updated the documentation if necessary
  • My changes are scoped to a single issue

@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

@vraj826 is attempting to deploy a commit to the Dot_NotSam's projects Team on Vercel.

A member of the Team first needs to authorize it.

@vraj826

vraj826 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

@SamXop123 Can you review the changes!

@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
samdev-pulse Ready Ready Preview, Comment Jun 9, 2026 5:58pm

@SamXop123 SamXop123 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 solid! thank you for the contribution

@SamXop123 SamXop123 merged commit ec44f40 into SamXop123:main Jun 9, 2026
4 checks passed
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

🎉 Congratulations @vraj826! 🎉

Your pull request has been successfully merged into samdev-pulse! Thank you so much for your valuable contribution and effort. Every single improvement helps make samdev-pulse a better profile experience for everyone! 🙌

🚀 What's Next?

  • Keep the momentum going! Feel free to browse through our open Issues and grab another one that interests you!
  • Support the Project: If you enjoyed contributing to samdev-pulse, please take a second to star our repository! It helps increase the project's visibility and supports our community. ⭐

💬 Stay Connected:
Have any questions, want feedback, or just want to discuss further contributions? Feel free to reach out directly to the maintainer on Discord: dot_notsam!

Thank you again, and keep up the amazing work! 💻✨

@vraj826 vraj826 deleted the refactor/shared-http-client branch June 10, 2026 06:04
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.

feat: Implement Shared HTTP Client with Timeouts and Graceful Third-Party Failure Handling

2 participants