WebHistoryService query end time not exclusive |
|||||
Issue descriptionWhen querying browsing history, an "end_time" is passed in as a query option. This end time is supposed to be exclusive, according to the documentation in history_types.h: https://cs.chromium.org/chromium/src/components/history/core/browser/history_types.h?q=queryoptions+end_time&sq=package:chromium&dr=CSs&l=235 It appears that for the regular local HistoryService the end time is exclusive, but for the WebHistoryService the end time is inclusive. Repro steps: 1) Make a query to BrowsingHistoryService with base::Time() for the end_time (match all results) and a max of X queries (e.g. X = 5) 2) Store the timestamp for the last history entry in C++ 3) Issue another query to BrowsingHistoryService with the stored timestamp for the end_time and a max of X queries 4) repeat steps 2-3 Observed behavior: duplicate results from the WebHistoryService appear at the query boundary e.g. if google.com is the last result returned in the query for #1, it will be the first result returned for the query in #3. Expected behavior: the end time is supposed to be exclusive I suspect this is a non-regression issue that has been hidden by the fact that our history web ui converts the C++ timestamp to/from JavaScript time. JavaScript uses less bits to represent the number so some precision is lost e.g. rather than 13123713486001564, the conversion to/from JavaScript causes the end_time to be 13123713486001000. This effectively sets the end_time used for the next query to an earlier date and hides WebHistoryService's non-exclusive use of end_time.
,
Dec 14 2016
,
Dec 16 2016
Confirmed. Good catch! We could fix the +/-1 errors and update the QueryOptions documentation to say that this behaves differently with local and web history, but I think it's cleaner to ask the serverside folks to use a half-closed interval. Those are not only used for time ranges all over Chrome, but, well, in computer science.
,
Dec 16 2016
Filed b/33686503.
,
Jan 12 2017
As discussed, the server is using closed intervals everywhere, and they don't want to make a one-off change for the API. Alright then, I'll fix this clientside.
,
Jan 12 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/39f5b80c5358f69f8407557990beed449fa03e74 commit 39f5b80c5358f69f8407557990beed449fa03e74 Author: msramek <msramek@chromium.org> Date: Thu Jan 12 16:07:14 2017 Fix the end time bound in WebHistoryService to match the API Change the exclusive end time bound in WebHistoryService to be inclusive, as required by the history.google.com API. BUG= 674165 Review-Url: https://codereview.chromium.org/2621143004 Cr-Commit-Position: refs/heads/master@{#443245} [modify] https://crrev.com/39f5b80c5358f69f8407557990beed449fa03e74/components/history/core/browser/web_history_service.cc
,
Jan 12 2017
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by twelling...@chromium.org
, Dec 14 2016