Page MenuHomePhabricator

Enforce tid equality of html and data-parsoid passed to Parsoid on html2wt serialization
Closed, ResolvedPublic

Description

We should enforce that data-parsoid and html (and later, other render metadata) all shares the same tid before we pass it to parsoid. The element ids used to link metadata with elements can currently change between renders, which means that the metadata is only consistent if it originated with the same render. We currently retrieve the latest render for a revision for each, which means that there is a very small window where a template update could have updated one part of information for the revision, but not the other.

If the tids/etags for both resources don't match, we should probably re-try to retrieve matching versions by adding the tid to the selection criteria. Alternatively, we could encourage clients to pass in the original tid. The advantage of doing that is that we'd also cover templates completely changing the page structure on template update. The disadvantage is client complexity. We could also do both & make passing in the tid optional.

Event Timeline

GWicke raised the priority of this task from to Needs Triage.
GWicke updated the task description. (Show Details)
GWicke added projects: RESTBase, Parsoid.
GWicke added a subscriber: GWicke.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 18 2015, 3:58 PM
GWicke triaged this task as Medium priority.Mar 18 2015, 3:59 PM
GWicke set Security to None.
GWicke edited subscribers, added: ssastry, Jdforrester-WMF; removed: Aklapper.
GWicke raised the priority of this task from Medium to High.Mar 25 2015, 6:42 PM
Elitre added a subscriber: Elitre.Mar 27 2015, 4:11 PM

For new content, this should be mostly addressed by https://github.com/wikimedia/restbase/pull/222.

GWicke closed this task as Resolved.Apr 1 2015, 1:33 AM
GWicke claimed this task.

Now that https://github.com/wikimedia/restbase/pull/222 is merged we generally rely on clients to pass in a timeuuid, either explicitly with an If-Match header, or via a mw:TimeUuid meta tag in HTML content. When the timeuuid is provided, the situation described here is effectively ruled out.