|
|
Chromium Code Reviews
DescriptionReport empty article as empty.
Dom Distiller adds "No data found" to the HTML if the page is empty.
This prevents RL to handle correctly the error.
BUG=648923
Committed: https://crrev.com/4af6f965f87724fcfc7b7e2b900522edf57a5212
Cr-Commit-Position: refs/heads/master@{#440391}
Patch Set 1 #
Total comments: 2
Patch Set 2 : done #
Total comments: 7
Patch Set 3 : feedback #Messages
Total messages: 25 (8 generated)
olivierrobin@chromium.org changed reviewers: + jif@chromium.org, wychen@chromium.org
Ideally DistilledArticleProto would contain a boolean informing whether an error occured or not. https://codereview.chromium.org/2594663005/diff/1/ios/chrome/browser/dom_dist... File ios/chrome/browser/dom_distiller/distiller_viewer.cc (right): https://codereview.chromium.org/2594663005/diff/1/ios/chrome/browser/dom_dist... ios/chrome/browser/dom_distiller/distiller_viewer.cc:44: is_empty = is_empty && article_proto->pages(i).html() == ""; Code that breaks out of the loop is easier to understand: bool is_empty = true; for (... if (article_proto->pages(i).html() != "") { is_empty = false; break; } }
True. Wychen, can we add this flag in the proto? https://codereview.chromium.org/2594663005/diff/1/ios/chrome/browser/dom_dist... File ios/chrome/browser/dom_distiller/distiller_viewer.cc (right): https://codereview.chromium.org/2594663005/diff/1/ios/chrome/browser/dom_dist... ios/chrome/browser/dom_distiller/distiller_viewer.cc:44: is_empty = is_empty && article_proto->pages(i).html() == ""; On 2016/12/21 13:36:33, jif wrote: > Code that breaks out of the loop is easier to understand: > > bool is_empty = true; > for (... > if (article_proto->pages(i).html() != "") { > is_empty = false; > break; > } > } Done.
I haven't built this, but with this CL, when the distilled content is an empty string, the users would no longer see "No data found." on Clank, right? What kind of error handling do you need on RL? https://codereview.chromium.org/2594663005/diff/20001/ios/chrome/browser/dom_... File ios/chrome/browser/dom_distiller/distiller_viewer.cc (right): https://codereview.chromium.org/2594663005/diff/20001/ios/chrome/browser/dom_... ios/chrome/browser/dom_distiller/distiller_viewer.cc:41: DomDistillerRequestViewBase::OnArticleReady(article_proto); In DomDistillerRequestViewBase::OnArticleReady(), "No data found" is added to js_buffer_.
On 2016/12/22 07:58:19, wychen wrote: > I haven't built this, but with this CL, when the distilled content is an empty > string, the users would no longer see "No data found." on Clank, right? > > What kind of error handling do you need on RL? > > https://codereview.chromium.org/2594663005/diff/20001/ios/chrome/browser/dom_... > File ios/chrome/browser/dom_distiller/distiller_viewer.cc (right): > > https://codereview.chromium.org/2594663005/diff/20001/ios/chrome/browser/dom_... > ios/chrome/browser/dom_distiller/distiller_viewer.cc:41: > DomDistillerRequestViewBase::OnArticleReady(article_proto); > In DomDistillerRequestViewBase::OnArticleReady(), "No data found" is added to > js_buffer_. This is in iOS directory. In our feature, we only need a distilled version if it succeeded. We prefer to tell the user that the page could not be distilled than showing an empty page.
Ah. Stupid me. Didn't notice it's in ios/. :p https://codereview.chromium.org/2594663005/diff/20001/ios/chrome/browser/dom_... File ios/chrome/browser/dom_distiller/distiller_viewer.cc (right): https://codereview.chromium.org/2594663005/diff/20001/ios/chrome/browser/dom_... ios/chrome/browser/dom_distiller/distiller_viewer.cc:43: for (int i = 0; i < article_proto->pages_size(); i++) { When the first distilled page is empty, even if the next page link is discovered, the link would be disregarded. The logic is here: https://cs.chromium.org/chromium/src/components/dom_distiller/core/distiller.... We did this because the distillability heuristic could still be wrong, and if the page is not an article, stitching a paginated part would be moot. Given this, we only need to check the first page here. Your current implementation is defensive, and I'm fine with it. https://codereview.chromium.org/2594663005/diff/20001/ios/chrome/browser/dom_... ios/chrome/browser/dom_distiller/distiller_viewer.cc:44: if (article_proto->pages(i).html() != "") { Using .empty() might be slightly better.
Thanks. PTAL https://codereview.chromium.org/2594663005/diff/20001/ios/chrome/browser/dom_... File ios/chrome/browser/dom_distiller/distiller_viewer.cc (right): https://codereview.chromium.org/2594663005/diff/20001/ios/chrome/browser/dom_... ios/chrome/browser/dom_distiller/distiller_viewer.cc:41: DomDistillerRequestViewBase::OnArticleReady(article_proto); On 2016/12/22 07:58:19, wychen wrote: > In DomDistillerRequestViewBase::OnArticleReady(), "No data found" is added to > js_buffer_. But IIUC, not the protobuf, correct? Should I do my check before this call? https://codereview.chromium.org/2594663005/diff/20001/ios/chrome/browser/dom_... ios/chrome/browser/dom_distiller/distiller_viewer.cc:43: for (int i = 0; i < article_proto->pages_size(); i++) { On 2016/12/22 10:19:33, wychen wrote: > When the first distilled page is empty, even if the next page link is > discovered, the link would be disregarded. The logic is here: > > https://cs.chromium.org/chromium/src/components/dom_distiller/core/distiller.... > > We did this because the distillability heuristic could still be wrong, and if > the page is not an article, stitching a paginated part would be moot. > > Given this, we only need to check the first page here. > > Your current implementation is defensive, and I'm fine with it. Done. This makes code simpler https://codereview.chromium.org/2594663005/diff/20001/ios/chrome/browser/dom_... ios/chrome/browser/dom_distiller/distiller_viewer.cc:44: if (article_proto->pages(i).html() != "") { On 2016/12/22 10:19:33, wychen wrote: > Using .empty() might be slightly better. Done.
lgtm https://codereview.chromium.org/2594663005/diff/20001/ios/chrome/browser/dom_... File ios/chrome/browser/dom_distiller/distiller_viewer.cc (right): https://codereview.chromium.org/2594663005/diff/20001/ios/chrome/browser/dom_... ios/chrome/browser/dom_distiller/distiller_viewer.cc:41: DomDistillerRequestViewBase::OnArticleReady(article_proto); On 2016/12/22 10:54:59, Olivier Robin wrote: > On 2016/12/22 07:58:19, wychen wrote: > > In DomDistillerRequestViewBase::OnArticleReady(), "No data found" is added to > > js_buffer_. > > But IIUC, not the protobuf, correct? > Should I do my check before this call? The protobuf should be intact, so no need to change. I was thinking about calling it conditionally, but it does other things.
The CQ bit was checked by olivierrobin@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Thanks for the review
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
olivierrobin@chromium.org changed reviewers: + noyau@chromium.org
+noyau as owner
lgtm
The CQ bit was checked by noyau@chromium.org
lgtm
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 40001, "attempt_start_ts": 1482409520273500,
"parent_rev": "229361aee3225674e106995a0a636f4d52ac3e0d", "commit_rev":
"9f88078b63b5b061ec8cc92dc6c8da0d6e01e7f1"}
Message was sent while issue was closed.
Description was changed from ========== Report empty article as empty. Dom Distiller adds "No data found" to the HTML if the page is empty. This prevents RL to handle correctly the error. BUG=648923 ========== to ========== Report empty article as empty. Dom Distiller adds "No data found" to the HTML if the page is empty. This prevents RL to handle correctly the error. BUG=648923 Review-Url: https://codereview.chromium.org/2594663005 ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001)
Message was sent while issue was closed.
Description was changed from ========== Report empty article as empty. Dom Distiller adds "No data found" to the HTML if the page is empty. This prevents RL to handle correctly the error. BUG=648923 Review-Url: https://codereview.chromium.org/2594663005 ========== to ========== Report empty article as empty. Dom Distiller adds "No data found" to the HTML if the page is empty. This prevents RL to handle correctly the error. BUG=648923 Committed: https://crrev.com/4af6f965f87724fcfc7b7e2b900522edf57a5212 Cr-Commit-Position: refs/heads/master@{#440391} ==========
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/4af6f965f87724fcfc7b7e2b900522edf57a5212 Cr-Commit-Position: refs/heads/master@{#440391} |
