Closed Bug 562795 Opened 14 years ago Closed 14 years ago

Sorting by name in the digest view is case-sensitive for all types of add-ons

Categories

(Toolkit :: Add-ons Manager, defect, P2)

defect

Tracking

()

VERIFIED FIXED
mozilla2.0b1
Tracking Status
blocking2.0 --- final+

People

(Reporter: jruderman, Assigned: mossop)

References

Details

(Whiteboard: [rewrite])

Attachments

(3 files, 1 obsolete file)

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.3a5pre) Gecko/20100429 Firefox/3.7a5pre

Tools > Add-ons > Plugins

iPhotoCast appears at the bottom when they're sorted by name (which is the default).  It should appear between "Default plugin" and "Lala download".
Blocks: 550048
Flags: in-testsuite?
Flags: in-litmus?
OS: Mac OS X → All
Hardware: x86 → All
Whiteboard: [rewrite]
Tools > Add-ons > Extensions
Also case sensitive.
Should be ignore case to sort by name.

Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a5pre) Gecko/20100429 Minefield/3.7a5pre ID:20100429143047
Summary: Plugin "sort by name" is case-sensitive → Sorting by name in the digest view is case-sensitive for all types of add-ons
Priority: -- → P2
blocking2.0: --- → final+
Assignee: nobody → dtownsend
Attached patch patch rev 1 (obsolete) — Splinter Review
Adds sort hints for the numeric fields and makes sorting default to ascending for name sorts. Tests the sorting.

The change to automation.py is because I neglected to change its value when we renumbered the scopes in bug 555486.
Attachment #451720 - Flags: review?(bmcbride)
Status: NEW → ASSIGNED
Comment on attachment 451720 [details] [diff] [review]
patch rev 1

Note: This also has the fix for bug 566760 (unregistering providers), which is needed for the initial work from bug 561687 (the mocking provider), which is needed for testing this. Dependency chains are fun!


>+user_pref("extensions.enabledScopes", 5);

Can you add a comment here - 5 is not descriptive.


>diff --git a/toolkit/mozapps/extensions/content/extensions.js b/toolkit/mozapps/extensions/content/extensions.js
>-    var size = Math.floor(Math.random() * 1024 * 1024 * 2);
>-    size = ("00000000000" + size).slice(-10); // HACK: nsIXULSortService doesn't do numerical sorting (bug 379745)
>-    item.setAttribute("size", size); // XXXapi - bug 561261
>+    if (aObj.size)
>+      item.setAttribute("size", aObj.size);

I think you'll also need to update _updateSize() in extensions.xml.

>+    if (["dateUpdated", "size", "relevancescore"].indexOf(aSortBy) >= 0)

This array used a couple of times (and might be used again in the future, eg bug 562622) - so should be a global constant.

>+    if (["dateUpdated", "size", "relevancescore"].indexOf(aSortBy) >= 0)

Ditto.

>+          // Name sorting defaults to ascending, others to descending
>+          this.ascending = aSort == "name";

Are we sure the name will be the only thing that will ever be sorted ascending by default? I'd rather have a global constant array, like above.

r=me with those changes.
Attachment #451720 - Flags: review?(bmcbride) → review+
Attached patch patch rev 2Splinter Review
Updated from comments, waiting on some other bugs to land first though.
Attachment #451720 - Attachment is obsolete: true
Attachment #451807 - Flags: review+
Landed: http://hg.mozilla.org/mozilla-central/rev/14383ec3611b
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Flags: in-testsuite?
Flags: in-testsuite+
Flags: in-litmus?
Flags: in-litmus-
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a6
Blocks: 566760
Had to revert the changes to automation.py.in due to update test failures. Also had to disable the testcase for the following common-random problem:

TEST-INFO | chrome://mochikit/content/browser/toolkit/mozapps/extensions/test/browser/browser_sorting.js | Running test 4
TEST-UNEXPECTED-FAIL | chrome://mochikit/content/browser/toolkit/mozapps/extensions/test/browser/browser_sorting.js | Should have seen the right order - Got ["test4@tests.mozilla.org", "test5@tests.mozilla.org", "test3@tests.mozilla.org", "test1@tests.mozilla.org", "test2@tests.mozilla.org"], expected ["test5@tests.mozilla.org", "test3@tests.mozilla.org", "test1@tests.mozilla.org", "test2@tests.mozilla.org", "test4@tests.mozilla.org"]
Flags: in-testsuite+ → in-testsuite?
(In reply to comment #9)
> Had to revert the changes to automation.py.in due to update test failures.
Were the failures for extension or app update?
(In reply to comment #10)
> (In reply to comment #9)
> > Had to revert the changes to automation.py.in due to update test failures.
> Were the failures for extension or app update?

App update, it's a little concerning perhaps since the change would have basically made the default theme visible during the test run. Mean to look at it tomorrow but if you have time then you're likely to spot the problem sooner than me
That is a tad disconcerting... it might be due to my not excluding SCOPE_APPLICATION in the test since I assumed that mochitest wouldn't return SCOPE_APPLICATION add-ons. I'll take a look.
Ok, the test failure was actually a real problem, no idea why it doesn't show up on OSX but the sort service only supports sorting 32-bit integers. The date numbers we use are larger than that so the sort service drops back to plain string sorting in that case. Fix coming up.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Turns out it is what I thought...  it is failing since it tries to disable the active theme. Easy enough to fix
Dave, I'm taking PTO tomorrow so please feel free to check this in if you r+ this patch... it works for me with extensions.enabledScopes = 5 and makes the test consistent with the app update code by excluding SCOPE_APPLICATION add-ons.
Attachment #452169 - Flags: review?(dtownsend)
Comment on attachment 452169 [details] [diff] [review]
app update test fix

Yeah I'll land that tomorrow once I've done a tryserver run with the automation change too
Attachment #452169 - Flags: review?(dtownsend) → review+
This will tide us over until 2038
Attachment #452177 - Flags: review?(bmcbride)
Comment on attachment 452177 [details] [diff] [review]
switch dates to fit in 32-bit integers

> This will tide us over until 2038

Famous last words ;)

>+      item.setAttribute("dateUpdated", aObj.updateDate.getTime() / 1000);

I'm a bit worried about the reason for this being lost in the mists of time (read: I'll see this, wonder why its there, and change it back). I can haz comment?
Attachment #452177 - Flags: review?(bmcbride) → review+
Landed the new patches:

http://hg.mozilla.org/mozilla-central/rev/892d1e84a0ef
http://hg.mozilla.org/mozilla-central/rev/fcf45fdb4747
Status: REOPENED → RESOLVED
Closed: 14 years ago14 years ago
Flags: in-testsuite? → in-testsuite+
Resolution: --- → FIXED
Verified fixed with Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.3a6pre) Gecko/20100624 Minefield/3.7a6pre
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: