Skip to content

fix(focus): enforce archive window in subscription feeds - #125

Open
Aquarius-Situla wants to merge 2 commits into
TypeType-Video:devfrom
Aquarius-Situla:fix/focus-feed-archive-limit
Open

Aquarius-Situla wants to merge 2 commits into
TypeType-Video:devfrom
Aquarius-Situla:fix/focus-feed-archive-limit

Conversation

@Aquarius-Situla

Copy link
Copy Markdown
Contributor

Summary

Enforces Focus mode's archiveDays cutoff for entertainment channels across subscription feeds (/subscriptions/feed and /subscriptions/shorts) and applies Focus filtering prior to pagination to prevent empty pages and stale nextpage cursors.


Key Changes

Focus Feed Filtering (FocusContentFilters.kt):

  • Added FocusProfile.keepsFeedVideo(video) to enforce both withinArchive(publishedMillis()) (exclusively for isEntertainment channels) and keepsVideo(...) gradual fade rules.
  • Updated SubscriptionFeedResponse.filterFocus (used by /subscriptions/shorts) to filter entries through keepsFeedVideo.

Pre-Pagination Filtering (SubscriptionFeedSnapshot.kt, SubscriptionFeedService.kt, SubscriptionFeedRoutes.kt):

  • Added optional focusProfile: FocusProfile? = null parameter to getPage and page.
  • Executed Focus filtering prior to offset/limit slicing and nextpage cursor generation, preventing empty pages and stale pagination cursors in order=oldest and group-filtered views.

Focus Pagination Unit Tests (FocusProfileTest.kt):

  • Added unit tests covering SubscriptionFeedResponse.filterFocus and SubscriptionFeedSnapshot.page pagination across both newest-first and oldestFirst = true ordering for entertainment vs. study/other channels.

Aquarius-Situla and others added 2 commits November 20, 2026 23:11
# Conflicts:
#	server-services/src/main/kotlin/dev/typetype/server/services/FocusContentFilters.kt
#	server-services/src/main/kotlin/dev/typetype/server/services/SubscriptionFeedSnapshot.kt
#	server-services/src/test/kotlin/dev/typetype/server/services/FocusProfileTest.kt

This branch has not been deployed

No deployments
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