Skip to content

Fix GET user neighbors APIs#1110

Merged
zhenghaoz merged 1 commit intomasterfrom
users
Nov 28, 2025
Merged

Fix GET user neighbors APIs#1110
zhenghaoz merged 1 commit intomasterfrom
users

Conversation

@zhenghaoz
Copy link
Collaborator

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the GET user neighbors APIs by adding a new endpoint for user-to-user recommendations and fixing a bug in the existing user neighbors endpoint. The main issue being addressed is the incorrect category parameter being passed to the search function, which was filtering results incorrectly.

  • Adds new /user-to-user/{name}/{user-id} endpoint that aligns with the item-to-item pattern
  • Fixes bug in /user/{user-id}/neighbors endpoint where []string{""} was incorrectly passed as categories instead of nil
  • Adds test coverage for both the new endpoint and the fixed endpoint

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
server/rest.go Adds new getUserToUser handler and fixes category parameter bug in getUserNeighbors by passing nil instead of []string{""}
server/rest_test.go Adds TestUserToUser to verify both /user-to-user/{name}/{user-id} and /user/{user-id}/neighbors endpoints return expected results

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Nov 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.14%. Comparing base (3b8ecdd) to head (7d65335).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1110      +/-   ##
==========================================
+ Coverage   71.09%   71.14%   +0.05%     
==========================================
  Files          86       86              
  Lines       15066    15071       +5     
==========================================
+ Hits        10711    10723      +12     
+ Misses       3299     3291       -8     
- Partials     1056     1057       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zhenghaoz zhenghaoz merged commit fff2a48 into master Nov 28, 2025
18 checks passed
@zhenghaoz zhenghaoz deleted the users branch November 28, 2025 16:38
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.

2 participants