diff --git a/projects/dev.yaml b/projects/dev.yaml index 4abee70c8..c29840bfc 100644 --- a/projects/dev.yaml +++ b/projects/dev.yaml @@ -113,8 +113,6 @@ paths: dependent_content_types: - name: data-parsoid value_type: json - - name: section-offsets - value_type: json /mobileapps: x-modules: - path: sys/mobileapps.js diff --git a/projects/example.yaml b/projects/example.yaml index 1dc2e5597..e6939dda5 100644 --- a/projects/example.yaml +++ b/projects/example.yaml @@ -72,7 +72,5 @@ paths: dependent_content_types: - name: data-parsoid value_type: json - - name: section-offsets - value_type: json options: '{{options}}' diff --git a/projects/wmf_default.yaml b/projects/wmf_default.yaml index cf707b091..fcde34195 100644 --- a/projects/wmf_default.yaml +++ b/projects/wmf_default.yaml @@ -127,8 +127,6 @@ paths: dependent_content_types: - name: data-parsoid value_type: json - - name: section-offsets - value_type: json /key_value: &sys_key_value x-modules: - path: sys/key_value.js diff --git a/projects/wmf_enwiki.yaml b/projects/wmf_enwiki.yaml index 20f0e7169..5f9ef3a58 100644 --- a/projects/wmf_enwiki.yaml +++ b/projects/wmf_enwiki.yaml @@ -154,8 +154,6 @@ paths: dependent_content_types: - name: data-parsoid value_type: json - - name: section-offsets - value_type: json /key_value: &sys_key_value x-modules: - path: sys/key_value.js diff --git a/projects/wmf_wikidata.yaml b/projects/wmf_wikidata.yaml index 3b77827c4..ec78a1cbe 100644 --- a/projects/wmf_wikidata.yaml +++ b/projects/wmf_wikidata.yaml @@ -109,8 +109,6 @@ paths: dependent_content_types: - name: data-parsoid value_type: json - - name: section-offsets - value_type: json /key_value: &sys_key_value x-modules: - path: sys/key_value.js diff --git a/projects/wmf_wikipedia.yaml b/projects/wmf_wikipedia.yaml index dff49dde2..88bae251f 100644 --- a/projects/wmf_wikipedia.yaml +++ b/projects/wmf_wikipedia.yaml @@ -154,8 +154,6 @@ paths: dependent_content_types: - name: data-parsoid value_type: json - - name: section-offsets - value_type: json /key_value: &sys_key_value x-modules: - path: sys/key_value.js diff --git a/projects/wmf_wikivoyage.yaml b/projects/wmf_wikivoyage.yaml index 5e0fa3d3b..efbb26074 100644 --- a/projects/wmf_wikivoyage.yaml +++ b/projects/wmf_wikivoyage.yaml @@ -149,8 +149,6 @@ paths: dependent_content_types: - name: data-parsoid value_type: json - - name: section-offsets - value_type: json /key_value: &sys_key_value x-modules: - path: sys/key_value.js diff --git a/projects/wmf_wiktionary.yaml b/projects/wmf_wiktionary.yaml index dc512eb76..b399ba58e 100644 --- a/projects/wmf_wiktionary.yaml +++ b/projects/wmf_wiktionary.yaml @@ -143,8 +143,6 @@ paths: dependent_content_types: - name: data-parsoid value_type: json - - name: section-offsets - value_type: json /key_value: &sys_key_value x-modules: - path: sys/key_value.js diff --git a/sys/parsoid.js b/sys/parsoid.js index 01feecb3a..1520956fb 100644 --- a/sys/parsoid.js +++ b/sys/parsoid.js @@ -257,33 +257,18 @@ class ParsoidService { uri: this.getNGBucketURI(rp, 'all', tid), body: { html: parsoidResp.body.html, - 'data-parsoid': parsoidResp.body['data-parsoid'], - 'section-offsets': { - headers: { - 'content-type': 'application/json' - }, - body: parsoidResp.body['data-parsoid'].body.sectionOffsets - } + 'data-parsoid': parsoidResp.body['data-parsoid'] } }); } saveParsoidResultToFallback(hyper, req, tid, parsoidResp) { const rp = req.params; - return P.all([ - hyper.put({ - uri: this.getFallbackBucketURI(rp, 'data-parsoid', tid), - headers: parsoidResp.body['data-parsoid'].headers, - body: parsoidResp.body['data-parsoid'].body - }), - hyper.put({ - uri: this.getFallbackBucketURI(rp, 'section-offsets', tid), - headers: { - 'content-type': 'application/json' - }, - body: parsoidResp.body['data-parsoid'].body.sectionOffsets - }), - ]) + return hyper.put({ + uri: this.getFallbackBucketURI(rp, 'data-parsoid', tid), + headers: parsoidResp.body['data-parsoid'].headers, + body: parsoidResp.body['data-parsoid'].body + }) .then(() => hyper.put({ uri: this.getFallbackBucketURI(rp, 'html', tid), headers: parsoidResp.body.html.headers, @@ -408,11 +393,11 @@ class ParsoidService { tid: etagInfo.tid }); return this._getContentWithFallback(hyper, sectionsRP, - 'section-offsets', sectionsRP.tid) - .then(sectionOffsets => mwUtil.decodeBody(htmlRes).then((content) => { + 'data-parsoid', sectionsRP.tid) + .then(dataParsoid => mwUtil.decodeBody(htmlRes).then((content) => { const body = cheapBodyInnerHTML(content.body); const chunks = sections.reduce((result, id) => { - const offsets = sectionOffsets.body[id]; + const offsets = dataParsoid.body.sectionOffsets[id]; if (!offsets) { throw new HTTPError({ status: 400, @@ -908,16 +893,6 @@ module.exports = (options) => { default_time_to_live: options.grace_ttl } }, - { - // TODO: the `-ng` is only here because we have just one cass cluster - // in dev. Remove before deploying to production - uri: '/{domain}/sys/key_rev_value/parsoid.stash.section-offsets-ng', - body: { - valueType: 'json', - version: 3, - default_time_to_live: options.grace_ttl - } - }, { uri: '/{domain}/sys/parsoid_bucket/' }