the-hobbes / website_time_tracker

A chrome extension to track where you spend your time on the web.
Other
3 stars 1 forks source link

Chrome api returns unexpected results. #17

Open the-hobbes opened 9 years ago

the-hobbes commented 9 years ago

I posted a stackoverflow question about this: http://stackoverflow.com/questions/29787549/chrome-history-api-returning-unexpected-results

@edgecaseberg pointed out a potential issue with the view of his browser history, as reported by the extension. The difference of the amount of requests for a particular domain in the year vs month view was unlikely (roughly a 33% increase in the last month for requests of that particular domain). This led me to do some digging, and it turns out that the restriction on how far back I am querying the History API aren't being enforced, either through a bug in my code (I can't find it), a misunderstanding of the History API, or something else.

EdgeCaseBerg commented 9 years ago

https://developer.chrome.com/extensions/history#method-search The documentation doesn't say it has to be ordered or anything, but it is weird that it's showing results What if you give it a endTime parameter as well?

the-hobbes commented 9 years ago

Same thing if I supply an end time parameter (using the current time as the end time0.

EdgeCaseBerg commented 9 years ago

Have you tried looking into the source code of the api itself?

the-hobbes commented 9 years ago

This function @EdgeCaseBerg found (https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/history/chrome_history_client.cc&l=86) seems to indicate that we might expect a bit of inconsistency as part and parcel of using the api, but the results you reported seem to be more unusual than what I would expect (although that is just a feeling, I've got nothing to back that up).

EdgeCaseBerg commented 9 years ago

I wonder if history being deleted would affect it? But still, getting results like those shown in your stackoverflow question is absurd.

the-hobbes commented 9 years ago

Filed a bug against chromoum(https://code.google.com/p/chromium/issues/detail?id=480723). Let's see what they say.

EdgeCaseBerg commented 9 years ago

Did you report that right?

reproduce problem:

  1. make extension (yes)
  2. Request weeks worth of history (yes)
  3. See only a weeks worth of history nothing older (isn't that the expected behavior? shouldn't you have written "see history older than a week in results" or something?)

On Thu, Apr 23, 2015 at 05:29:06PM -0700, Phelan Vendeville wrote:

Filed a bug against chromoum(https://code.google.com/p/chromium/issues/detail?id=480723). Let's see what they say.


Reply to this email directly or view it on GitHub: https://github.com/the-hobbes/website_time_tracker/issues/17#issuecomment-95762051

~Ethan J. Eldridge http://www.ethanjoachimeldridge.info Programmer | Computer Scientist Former UVM CS Crew Executive Triumvirate Member Former UPE UVM Chapter President PGP Key: EFFF2B10 on pgp.mit.edu

the-hobbes commented 9 years ago

Thanks, I've updated the bug

EdgeCaseBerg commented 9 years ago

No problem. Just want to make sure the maintainers can fix it for ya :D