What is flagged_rev?
flagged_revs are revisions that are pending review. We call the approved revision the stable revision, which can be older than the most recent aka latest revision. Logged out users do not see the latest revision. Logged in users can choose to see the latest revision, it comes with a warning saying revision is a pending review. See Special:PendingChanges for examples. Change language wiki to see other wikis.
Some analysis on number of pending reviews per wiki: Analysis.
Attribution API and Feature Counts
Attribution API (Prep Pantry Doc) wants to surface feature counts such as number of citations, references, sources. Per the design, we plan on warming the Linked Artifact Cache (LAC) with the feature counts on every page change. This means LAC will always have the latest revision cached. Other revision IDs can be queried too, but it won't usually be cached and will require an on-demand compute. Scenarios:
- stable/latest rev1 in LAC. Typical scenario. Attribution API calls for rev1 and values returned from cache.
- New latest rev2 in cache, invalidates all old revisions, including stable rev1. Attribution API wants reference counts for rev1. LAC computes and returns feature counts for rev1. Now LAC has both rev1 and rev2 cached.
- New latest revision rev3, invalidates all old revisions, including rev1 and rev2. Attribution API wants stable rev1. LAC computes and returns feature counts for rev1. Now LAC has both rev1 and rev3 cached.
The frequency of such scenarios is not known, but given the single digit percentage of wiki pages with pending revisions, and given that active wikis and pages have revisions reviewed fast, this should not be too often.
Also note, every revision does not necessarily change reference counts. See comment. The distribution can be difference across wikis: see Analysis.
To Do
The purpose of this ticket is to work on the requirements for flagged revisions. As of design review of 20 Aug, 2026; the idea was to return null when the reference/citation counts are not available in cache to prevent Attribution API from waiting on on-demand compute. LAC can still run and compute the revision asked for async and will have warmed the cache for when Attribution API asks for the revision again.
Resolved is: We know how to handle flagged revisions for reference counts LAC design.
Please comment with more details/questions/solutions.
Related: T433607: Provide a way to query the LAC without triggering a compute job on a cache miss
