Page MenuHomePhabricator

Feed poller must not use long-lived MediaWiki Redis cache
Closed, ResolvedPublicBUG REPORT

Description

Summary

The live feed poller (Toolforge continuous job: python -m app.services.poller) calls MediaWikiClient.get_user_contribs / get_article_revisions, which cache results in Redis for 300 seconds.

The poller never bypasses that cache (get_user_contribs has no refresh path). After the first poll fills the cache, new revids can be missed until TTL expiry — WebSocket notifications can lag by up to ~5 minutes plus the poll interval when EventStreams is off (default Toolforge path).

Important detail

Dashboard uses default limit=20 cache keys (contribs:…:20, revisions:…:20). Poller uses limit=10 (…:10). Keys differ — lag is from poller self-caching, not from the dashboard “warming” the poller’s keys.

Code

  • backend/app/services/feed_poller.pypoll_once
  • backend/app/services/mediawiki.pyCONTRIBS_CACHE_TTL / REVISIONS_CACHE_TTL = 300; get_user_contribs, get_article_revisions

Proposed fix (pick one)

  • Always bypass cache for poller-only fetches, or
  • Separate poller keys with no write / TTL 0, or
  • Add refresh=True to get_user_contribs and pass it from the poller (articles already support refresh)

Interactive dashboard may keep short TTL cache.

Acceptance criteria

  • With EventStreams disabled, a new edit becomes notifiable within about one poll interval after MediaWiki shows it
  • Dashboard can still use caching for interactive load
  • Test (mocked Redis) proves poller does not return a stale revid list when a newer revid exists upstream

Event Timeline

Arian_Ar triaged this task as High priority.
Arian_Ar changed the task status from Open to In Progress.Jul 11 2026, 10:46 AM
Arian_Ar moved this task from Backlog to In Review on the Tool-sentinel board.
Arian_Ar moved this task from In Review to In Progress on the Tool-sentinel board.
Arian_Ar moved this task from In Progress to In Review on the Tool-sentinel board.
Arian_Ar moved this task from In Review to Done on the Tool-sentinel board.