Page MenuHomePhabricator

Get rev id from the etag
Open, MediumPublic1 Estimated Story Points

Description

  • The about attribute on the <html> tag (not part of the <head>, but worth mentioning). This contains the revid, which is used to determine whether the HTML VE received actually corresponds to the revid it was expecting to get (*)

The served rev_id is returned in the ETag header by RESTBase (the ETag format is <rev_id>/<time_uuid>). Given that VE already uses the ETag for the TimeUUID, it could use it for revision-collision detection as well.

Ooh, nice, I didn't realize that. That's also less ugly to parse than about="http://en.wikipedia.org/wiki/Special:Redirect/revision/540443854". Currently that's being parsed with:

		aboutDoc = this.doc.documentElement.getAttribute( 'about' );
		if ( aboutDoc ) {
			docRevIdMatches = aboutDoc.match( /revision\/([0-9]*)$/ );
			if ( docRevIdMatches.length >= 2 ) {
				docRevId = parseInt( docRevIdMatches[ 1 ] );
			}
		}

So VE should probably switch to that.

Event Timeline

Problem: The ETag isn't available if you aren't using RESTBase.

Jdforrester-WMF set the point value for this task to 1.

Problem: The ETag isn't available if you aren't using RESTBase.

This can be solved in two ways:

  1. Have Parsoid serve the ETag too
  2. Have VE check for the ETag and fall back to metadata present in the HTML

Frankly, I think both should be done.

Also, not related to this task, but it makes me think: is it perhaps time to start contemplating switching VE to use RB only?

Also, not related to this task, but it makes me think: is it perhaps time to start contemplating switching VE to use RB only?

Does RB support private wikis yet?

Does RB support private wikis yet?

Yes, but we yet have to enable switching the private wikis to using RESTBase, cf. T88016#1624648