Closed Bug 515463 Opened 15 years ago Closed 15 years ago

new async autocomplete does not always respect behavior pref changes

Categories

(Firefox :: Address Bar, defect, P2)

defect

Tracking

()

VERIFIED FIXED
Firefox 3.7a1
Tracking Status
status1.9.2 --- beta1-fixed

People

(Reporter: mak, Assigned: sdwilsh)

References

Details

(Keywords: privacy, regression)

Attachments

(1 file, 1 obsolete file)

If you look at mixed (history and bookmarks) results and you flip the UI pref through values values, you can end up viewing bookmarks when history is selected, or viceversa (i've also seen results with Nothing selected)
Flags: blocking-firefox3.6?
Keywords: privacy
Was working in Firefox 3.5.. might be related to the rewrite. I do see that we register a "" pref observer and reload all the prefs.
Keywords: regression
Depends on: 455555
Blocks: 455555
No longer depends on: 455555
We only register for "browser.urlbar." changes.
blocking for broken UI and potential privacy exposure.
Flags: blocking-firefox3.6? → blocking-firefox3.6+
Not healthy to have blockers assigned to nobody@ - shawn, mardak, who's taking this?
assigning to shawn since it sounds like an asyncbar regression. reassign as needed.
Assignee: nobody → sdwilsh
Status: NEW → ASSIGNED
Whiteboard: [needs patch]
Priority: -- → P2
Can somebody give me more specific steps to reproduce?  I thought I understood this bug, but it appears that I do not!
1. create a new profile
2. search for "moz" in the locationbar, you get results
3. change options -> privacy -> locationbar to "nothing"
4. search for "moz" in the locationbar, you don't get results
5. change options -> privacy -> locationbar to anything other than "nothing"
6. search for "moz" in the locationbar, you don't get results!

iirc i was able to reproduce even in opposite directions, so not willing to see results i was seeing them.
For example actually i have the pref set to "bookmarks" but i only see history results...

restarting browser fixes the issue.
Silly me (and reviewers!).  We don't hold onto our preference branch, so our observer can disappear.  D'oh!  Patch RSN!
Attached patch v1.0 (obsolete) — Splinter Review
Attachment #403346 - Flags: review?(mak77)
Whiteboard: [needs patch] → [needs review mak]
Comment on attachment 403346 [details] [diff] [review]
v1.0

>+      let pb = this._prefs.QueryInterface(Ci.nsIPrefBranch2);
>       pb.addObserver("", this, false);
Why do we need to hold a reference to the prefs branch? Is that just so that there's a cycle between autocomplete and prefs and the GC doesn't collect it? I'm still not sure what's being collected to begin with..

Also, isn't that last argument "false" supposed to keep a strong reference -- not that autocomplete is getting collected in the first place.. ?
(In reply to comment #10)
> Why do we need to hold a reference to the prefs branch? Is that just so that
> there's a cycle between autocomplete and prefs and the GC doesn't collect it?
> I'm still not sure what's being collected to begin with..
Pretty much.  The preference branch will get a refcount of zero, and it will be deleted, taking our observer with it.
Attached patch v1.1Splinter Review
per comments on irc
Attachment #403346 - Attachment is obsolete: true
Attachment #403351 - Flags: review?(mak77)
Attachment #403346 - Flags: review?(mak77)
Ah, that makes much more sense. I was getting confused trying to figure out how the pref service was going away, but it's just the particular branch we're requesting that disappears.
Comment on attachment 403351 [details] [diff] [review]
v1.1

reviewed on IRC and manually tested working, r=me

Still this gc thing is pretty strange looking, i would have expected that being the pref service still alive, branches derived from it were alive as well.
I think could make sense to file a bug that blocks this and fuel issue about this thing, if no bug exists as of today. Could even be correct to avoid holding useless branches in memory but it's quite error-prone.
Attachment #403351 - Flags: review?(mak77) → review+
Whiteboard: [needs review mak] → [has patch][can land]
i was thinking if flagging in-litmus is correct. the bug is reproduceable, but having a bug depending on gc on litmus could bring random results... maybe we should just flag it for generic: "set pref and check, unset pref and check"
(In reply to comment #15)
> i was thinking if flagging in-litmus is correct. the bug is reproduceable, but
> having a bug depending on gc on litmus could bring random results... maybe we
> should just flag it for generic: "set pref and check, unset pref and check"
Agreed.

(In reply to comment #14)
> Still this gc thing is pretty strange looking, i would have expected that being
> the pref service still alive, branches derived from it were alive as well.
> I think could make sense to file a bug that blocks this and fuel issue about
> this thing, if no bug exists as of today. Could even be correct to avoid
> holding useless branches in memory but it's quite error-prone.
I recall discussions about this in the past saying that this is an invariant of the pref observer API.
Flags: in-testsuite-
Flags: in-litmus?
Whiteboard: [has patch][can land] → [can land]
http://hg.mozilla.org/mozilla-central/rev/62d4f947aab5
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Whiteboard: [can land]
Target Milestone: --- → Firefox 3.7a1
This is covered in litmus FFT set.
Flags: in-litmus? → in-litmus+
verified with: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.3a1pre) Gecko/20091111 Minefield/3.7a1pre
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: