Skip to content

Fix hidden and expired items in recommendation results#1192

Closed
eyupcanakman wants to merge 2 commits intogorse-io:masterfrom
eyupcanakman:fix/764-hidden-items-recommendations
Closed

Fix hidden and expired items in recommendation results#1192
eyupcanakman wants to merge 2 commits intogorse-io:masterfrom
eyupcanakman:fix/764-hidden-items-recommendations

Conversation

@eyupcanakman
Copy link
Copy Markdown
Contributor

@eyupcanakman eyupcanakman commented Mar 9, 2026

Fixes #764

Summary

Recommendation results could still include hidden items and items older than item_ttl.

Filter cached and fallback recommendation results against current item metadata, and keep scanning past filtered entries so valid items still fill the response. Keep cache-only IDs without item rows unchanged.

Testing

  • go test ./logics ./server ./worker -count=1
  • go test ./... -run '^$' -count=1

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 10, 2026

Codecov Report

❌ Patch coverage is 79.31034% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.74%. Comparing base (b507ecb) to head (6bcce5e).
⚠️ Report is 18 commits behind head on master.

Files with missing lines Patch % Lines
logics/recommend.go 79.31% 9 Missing and 9 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1192      +/-   ##
==========================================
+ Coverage   72.72%   72.74%   +0.01%     
==========================================
  Files          88       88              
  Lines       16258    16333      +75     
==========================================
+ Hits        11824    11881      +57     
- Misses       3233     3242       +9     
- Partials     1201     1210       +9     

☔ 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.

Comment thread logics/recommend.go
Comment thread logics/recommend.go
@eyupcanakman
Copy link
Copy Markdown
Contributor Author

#1206 now pushes ItemTTL into the storage query and #1197 keeps hidden items out of the item-to-item index. The remaining paths (Recommend, Collaborative, NonPersonalized, UserToUser, External) still aren't filtered. Want me to rebase and narrow this to those, or close it and file smaller follow-ups that match your approach?

@zhenghaoz
Copy link
Copy Markdown
Collaborator

#1206 now pushes ItemTTL into the storage query and #1197 keeps hidden items out of the item-to-item index. The remaining paths (Recommend, Collaborative, NonPersonalized, UserToUser, External) still aren't filtered. Want me to rebase and narrow this to those, or close it and file smaller follow-ups that match your approach?

Thank you for your reply. New BatchGetItem could be used for filtering now. You could close this PR if rebase is more hard than open a new one.

@eyupcanakman
Copy link
Copy Markdown
Contributor Author

Closing. I'll open a narrower follow-up using the new BatchGetItems options.

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.

item_ttl and IsHidden not working

2 participants