Closed Bug 1025829 Opened 11 years ago Closed 11 years ago

[Single Variant] Top Sites are not ordered correctly

Categories

(Firefox OS Graveyard :: Gaia::Browser, defect)

Other
Other
defect
Not set
normal

Tracking

(blocking-b2g:2.0+, b2g-v2.0 fixed, b2g-v2.1 fixed)

VERIFIED FIXED
2.0 S4 (20june)
blocking-b2g 2.0+
Tracking Status
b2g-v2.0 --- fixed
b2g-v2.1 --- fixed

People

(Reporter: rafael.marquez, Assigned: albert)

References

Details

(Whiteboard: [systemsfe])

Attachments

(1 file)

363 bytes, text/html
benfrancis
: review+
Details
*Pre-requisites topsites_movistar.json: { "topSites": [ { "title": "Movistar", "uri": "http://www.movistar.es/", "iconPath": "resources/movistar.ico" }, { "title": "Betis", "uri": "http://www.realbetisbalompie.es/es/", "iconPath": "resources/pig.ico" }, { "title": "Marca", "uri": "http://www.marca.com/", "iconPath": "resources/pig.ico" }, { "title": "As", "uri": "http://as.com/", "iconPath": "resources/movistar.ico" } ] } *Procedure 1. Complete the FTE with a configured sim card 2. Open browser app *Expected Result Top Sites are ordered correctly: Movistar, Betis, Marca and AS *Actual Result Top Sites are not ordered correctly: Betis, Movistar, Marca and AS
blocking-b2g: --- → 2.0?
Whiteboard: [systemsfe]
Assignee: nobody → acperez
Currently database returns elements with same frequency sorted alphabetically in inverse order.
Attached file Patch
Used negative values to sort topsites.
Attachment #8440785 - Flags: review?(bfrancis)
blocking-b2g: 2.0? → 2.0+
Blocks: 1026439
Comment on attachment 8440785 [details] Patch R+ with nits and failing tests fixed, thanks.
Attachment #8440785 - Flags: review?(bfrancis) → review+
Target Milestone: --- → 2.0 S4 (20june)
Comment on attachment 8440785 [details] Patch Sorry for requesting review again Ben, but I had to modify some code because travis error was produced by a race condition. When opening the database first time callback is called before database is populated and this was causing the error. Updated patch simplifies single variant population, instead of search default topsites in the database before saving the single variant ones, I assign a frequency of -20 (max history) to the default topsites, then I can save single variant topsites faster. I also added small piece of code that fixes bug 1026439, when calling initTopSite if frequency for that place exists and it is bigger than 0 the topsite is not overridden.
Attachment #8440785 - Flags: review+ → review?(bfrancis)
Comment on attachment 8440785 [details] Patch Hmm, the number 20 is a bit arbitrary and overloading the frecency value like this is a bit of hack, but let's go with this for 2.0. It will be different if we implement it in the system browser anyway.
Attachment #8440785 - Flags: review?(bfrancis) → review+
(In reply to Ben Francis [:benfrancis] from comment #5) > Comment on attachment 8440785 [details] > Patch > > Hmm, the number 20 is a bit arbitrary and overloading the frecency value > like this is a bit of hack, but let's go with this for 2.0. It will be > different if we implement it in the system browser anyway. I agree, I used 20 because is the default value for topsites in the awesome screen https://github.com/mozilla-b2g/gaia/blob/master/apps/browser/js/awesomescreen.js#L13
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
when you will do the merge to v2.0?
Flags: needinfo?(ryanvm)
I was on PTO last week and am still catching up.
Flags: needinfo?(ryanvm)
Verified in 2.0
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: