Skip to content

Feed-health review fixes (follow-up to #700) - #703

Merged
mircealungu merged 1 commit into
masterfrom
wt/feed-health-fixes
Aug 14, 2026
Merged

Feed-health review fixes (follow-up to #700)#703
mircealungu merged 1 commit into
masterfrom
wt/feed-health-fixes

Conversation

@mircealungu

Copy link
Copy Markdown
Member

Follow-up to #700, applying the code-review findings that landed after it was merged.

  • N+1 removedactive_users_by_segment batches the CEFR lookup into one UserLanguage query instead of calling cefr_level_for_learned_language() per active user.
  • Canary is meaningful — picks a median-activity user rather than the most-recently-seen one (the heaviest reader, whose personal feed is legitimately empty most days, making corroboration useless).
  • Infra ≠ empty — an inventory-probe exception now yields STATUS_ERROR, not STATUS_EMPTY, so a transient ES outage isn't reported as "the segment has no content" (subject reflects empty/stale/error).
  • Timezone_hit_published_time converts tz-aware timestamps to local before comparison with datetime.now(), instead of stripping tzinfo (which mis-ages UTC values by the server offset).
  • Documented limitation — the inventory signal models CEFR filtering but not per-user feature-flag filtering; noted as a known tradeoff (moot since On-demand simplification: assess-only crawl + per-level preview summaries #698 made feeds originals-first).
  • Tests — added coverage for _to_local_naive and _hit_published_time (19 passing).

🤖 Generated with Claude Code

- Batch the CEFR lookup in active_users_by_segment (one UserLanguage query
  instead of one per active user).
- Canary picks a MEDIAN-activity user, not the most-recently-seen (heaviest
  reader, whose feed is legitimately empty most days -> useless corroboration).
- Distinguish infra failure from emptiness: inventory-probe exceptions now yield
  STATUS_ERROR, not STATUS_EMPTY, so an ES hiccup isn't reported as 'no content'.
- _hit_published_time converts tz-aware timestamps to local before comparing
  against datetime.now(), instead of blindly stripping tzinfo.
- Document that the inventory signal models CEFR but not per-user feature-flag
  filtering (moot post-#698).
- Tests for _to_local_naive + _hit_published_time.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

ArchLens - No architecturally relevant changes to the existing views

@mircealungu
mircealungu merged commit 053a073 into master Aug 14, 2026
2 of 3 checks passed
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.

1 participant