Page MenuHomePhabricator

Missing timestamps: data-mw-ts present in RecentChanges and Watchlist, but missing in Contributions/DeletedContributions and page history
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Go to Special:Contributions or Special:DeletedContributions for any user, or go to the history for any page.
  • Inspect the HTML of contribution or history list items in the browser developer tools.

What happens?:

Contribution lists (both Special:Contributions and Special:DeletedContributions) and page history pages include revision IDs in data-mw-revid attributes but do not include timestamps in any data attributes. The timestamps are only visible as formatted text in the user's preferred date format, but are unavailable as machine-readable data.

What should have happened instead?:

Timestamps should be available in machine-readable data attributes (like data-mw-ts) consistently across all revision listing interfaces, similar to how:

  • Special:RecentChanges and Special:Watchlist already correctly include data-mw-ts attributes on list items.
  • Revision IDs are consistently provided via data-mw-revid across all interfaces.
  • Diff pages include timestamps in .mw-diff-timestamp elements with data-timestamp attributes.

The inconsistency means that client-side code needs to do one or more of the following:

  • Parse visible text timestamps, which is difficult to do reliably when users have non-ISO date formats, and doesn't include seconds for most supported formats.
  • Make additional API calls to fetch timestamp data (increasing server load).
  • Extract timestamps from URL parameters when available (e.g., it's possible on deleted contributions pages, but it's a pretty hacky workaround).

For example, https://en.wikipedia.org/wiki/User:Daniel_Quinlan/Scripts/Unfiltered.js#L-16--L-337 shows some of the complexities and overhead involved for scripts in going from revids to timestamps when it should be dead simple.

Another similar script simply always fetches timestamps: https://en.wikipedia.org/wiki/User:Ingenuity/AbuseFilterContribs.js

And other scripts use one or more of those workarounds.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

All WMF-hosted wikis.

Other information (browser name/version, screenshots, etc.):

N/A