Implement a places database

RESOLVED FIXED in 2.1 S3 (29aug)


Firefox OS
4 years ago
4 years ago


(Reporter: kgrandon, Assigned: daleharvey)


2.1 S3 (29aug)
Gonk (Firefox OS)

Firefox Tracking Flags

(Not tracked)


(Whiteboard: [systemsfe])


(1 attachment)



4 years ago
Currently we use an "in-memory datastore" to load all of the places results whenever the search app or new tab page loads. I believe the consensus is that we should be using indexedDB store instead. Since we are rapidly approaching the 2.1 FL date, we should do whatever the minimum amount of work necessary to meet all of our requirements are.

Comment 1

4 years ago
Dale - do you know if we have an existing bug anywhere that would track this work? I'm a bit concerned about this one as it seems as it might be tricky to get right and take some iteration. If we want to do this for 2.1, can we make this a priority?
Flags: needinfo?(dale)
I swear I filed one for candice, but I cant find it now, I will use this for now, but I am not so worried about it, we originally planned for the end of this sprint so going to aim to get a first implementation done for tomorrow
Flags: needinfo?(dale)
Assignee: nobody → dale
Created attachment 8476220 [details] [review]

Working on the tests now, partially in combination with so I wanted to have this looked at while I worked on them

Francisco this is gonna conflict with your icons patch but trivially at the point we pick up the icon in search.js which has been simplified

Definitely not landing prior to the tests, but I think this is in a good enough place to be looked at

I didnt make a replacement for places_preload since that was a hack and will be working on its proper replacement next
Attachment #8476220 - Flags: review?(kgrandon)
Attachment #8476220 - Flags: feedback?(francisco)

Comment 4

4 years ago
Comment on attachment 8476220 [details] [review]

Dale this is awesome, thanks for knocking this out. Few things I noticed during this pass:

1 - Failing unit places_test.js unit test. I suppose we should try to keep this working while we get integration tests up, though seems that might be tricky with IDB.

2 - I'm not seeing places results in the search app. I guess we are trying to get these tests running again. Do you know if this should work?
Attachment #8476220 - Flags: review?(kgrandon)
1. Yeh I have the unit test fixed as well as new unit tests for places, thats all sorted and will be up soon

2. Should definitely be working, one thing I have noticed is that the ordering may differ now that we arent pulling them from memory, but ill take a look before I up the 2nd version with tests
Comment on attachment 8476220 [details] [review]

Fixed places.js unit tests and added new tests for the screenshot functionality, plus new tests for places_idb.js
Attachment #8476220 - Flags: review?(kgrandon)

Comment 7

4 years ago
Comment on attachment 8476220 [details] [review]

I think something like this would be fine for now, thanks for knocking it out. Is this the proper algorithm for frecency?
Attachment #8476220 - Flags: review?(kgrandon) → review+
No, firefox proper uses a decaying algorithm for places, this doesnt change the behaviour of the frecency which is the same as we had in the previous browser, since the fxos implementation is vastly different from desktop (one result per host etc) not sure how much of an impact the decay will have, but can look in a follow up
Comment on attachment 8476220 [details] [review]

I saw that you took into account the ugly patch for passing the icon url, don't have anything else to add here.

Excellent job!
Attachment #8476220 - Flags: feedback?(francisco) → feedback+
Target Milestone: 2.1 S2 (15aug) → 2.1 S3 (29aug)

I took out test/providers/places.js, it was a single test that is much better covered in places_idb_test.js, the way the places test was setup meant it touched too many things and was extremely brittle
Last Resolved: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.