Skip to content

fix: remove duplicate /api/recommend route#1653

Merged
leonagoel merged 2 commits into
leonagoel:mainfrom
saurabhhhcodes:fix/recommend-route-collision
Jun 21, 2026
Merged

fix: remove duplicate /api/recommend route#1653
leonagoel merged 2 commits into
leonagoel:mainfrom
saurabhhhcodes:fix/recommend-route-collision

Conversation

@saurabhhhcodes

Copy link
Copy Markdown

Summary

Fixes #1649.

What changed

  • Moved the orphaned paginated recommendations handler off GET /api/recommend and onto GET /api/recommend/paginated.
  • Kept the canonical /api/recommend and /api/recommend/{item_title} handlers intact for the existing query/title flow.
  • Fixed the query-title ordering in the main recommendation handler so cache keys are built after the request title is resolved.
  • Added a regression test that asserts the route registry has exactly one GET /api/recommend handler and one paginated handler.

Validation

  • python3 -m py_compile backend/main.py tests/test_recommend_api.py
  • git diff --check

Notes

The local test runner still hits an environment dependency gap when importing the app (websockets.asyncio), so I used syntax and route-registry validation for this branch.

@github-actions

Copy link
Copy Markdown

🎉 Welcome to Hybrid Recommender, @saurabhhhcodes! This is your first contribution here!

Labels added: gssoc:approved | mentor:leonagoel | status:review-needed

PR Description Checklist:

YES - What changed section
NO - Why section
NO - How to test section
YES - Related issue linked

⚠️ Some required sections are missing. Please update your PR description.

What happens next:

  1. @leonagoel will review your changes
  2. CI checks must pass
  3. Once approved, this PR will be auto-merged

⏱️ Please respond to review comments within 48 hours.

@github-actions

Copy link
Copy Markdown

⚠️ Main branch was just updated!

PR #1633 ("fix: Duplicate results-processing loop removed from search_items(#1631)") was just merged into main.

Please rebase your branch to avoid conflicts:

git fetch origin
git rebase origin/main
git push --force-with-lease

Keeping your branch up to date prevents merge conflicts. 🚀

@github-actions

Copy link
Copy Markdown

⚠️ Main branch was just updated!

PR #1640 ("fix: resolve hybrid_model merge conflicts and add explanation string") was just merged into main.

Please rebase your branch to avoid conflicts:

git fetch origin
git rebase origin/main
git push --force-with-lease

Keeping your branch up to date prevents merge conflicts. 🚀

@github-actions

Copy link
Copy Markdown

⚠️ Main branch was just updated!

PR #1641 ("Fix/svd memory leak") was just merged into main.

Please rebase your branch to avoid conflicts:

git fetch origin
git rebase origin/main
git push --force-with-lease

Keeping your branch up to date prevents merge conflicts. 🚀

@github-actions

Copy link
Copy Markdown

⚠️ Main branch was just updated!

PR #1642 ("Feature/evaluation dashboard") was just merged into main.

Please rebase your branch to avoid conflicts:

git fetch origin
git rebase origin/main
git push --force-with-lease

Keeping your branch up to date prevents merge conflicts. 🚀

@github-actions

Copy link
Copy Markdown

⚠️ Main branch was just updated!

PR #1643 ("Feature/streamlit tfidf config") was just merged into main.

Please rebase your branch to avoid conflicts:

git fetch origin
git rebase origin/main
git push --force-with-lease

Keeping your branch up to date prevents merge conflicts. 🚀

@github-actions

Copy link
Copy Markdown

⚠️ Main branch was just updated!

PR #1644 ("Fix/strict csrf origin validation") was just merged into main.

Please rebase your branch to avoid conflicts:

git fetch origin
git rebase origin/main
git push --force-with-lease

Keeping your branch up to date prevents merge conflicts. 🚀

@github-actions

Copy link
Copy Markdown

⚠️ Main branch was just updated!

PR #1645 ("Feature/svd online updating") was just merged into main.

Please rebase your branch to avoid conflicts:

git fetch origin
git rebase origin/main
git push --force-with-lease

Keeping your branch up to date prevents merge conflicts. 🚀

@github-actions

Copy link
Copy Markdown

⚠️ Main branch was just updated!

PR #1647 ("fix: add title query param endpoint to resolve HTTP 422 (#1075)") was just merged into main.

Please rebase your branch to avoid conflicts:

git fetch origin
git rebase origin/main
git push --force-with-lease

Keeping your branch up to date prevents merge conflicts. 🚀

@github-actions

Copy link
Copy Markdown

⚠️ Main branch was just updated!

PR #1648 ("fix(federated): prevent regularization decay in aggregate_updates") was just merged into main.

Please rebase your branch to avoid conflicts:

git fetch origin
git rebase origin/main
git push --force-with-lease

Keeping your branch up to date prevents merge conflicts. 🚀

@github-actions

Copy link
Copy Markdown

⚠️ Main branch was just updated!

PR #1650 ("fix: remove duplicate code block in hybrid_model.py causing Indentati…") was just merged into main.

Please rebase your branch to avoid conflicts:

git fetch origin
git rebase origin/main
git push --force-with-lease

Keeping your branch up to date prevents merge conflicts. 🚀

@leonagoel

Copy link
Copy Markdown
Owner

🎉 Merged!

Points will reflect on the GSSoC leaderboard at next 4 AM IST refresh.

🏆 https://gssoc.girlscript.org/leaderboard

This was referenced Jun 21, 2026
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]: Duplicate /api/recommend Route Registrations in backend/main.py

3 participants