Closed Bug 1055771 Opened 5 years ago Closed 5 years ago

Search suggestions for old query appear when activity is re-launched

Categories

(Firefox for Android Graveyard :: Search Activity, defect)

All
Android
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 34

People

(Reporter: Margaret, Assigned: Margaret)

References

Details

Attachments

(1 file, 1 obsolete file)

Maybe this is a regression from bug 1052563.
We don't update suggestions when the text changes if the search bar isn't active. So in order to reset the suggestions we need to make sure to activate editing mode before resetting the query.
Attachment #8475514 - Flags: review?(wjohnston)
Comment on attachment 8475514 [details] [diff] [review]
Reset search suggestions when activity is launched from a new intent

Review of attachment 8475514 [details] [diff] [review]:
-----------------------------------------------------------------

I would probably make that comment a little more strongly worded. i.e. Something like "Suggestions won't update if we're not in edit mode." makes it clearer to me than "Reset the query after entering edit mode to update the suggestions appropriately."
(In reply to Wesley Johnston (:wesj) from comment #2)
> Comment on attachment 8475514 [details] [diff] [review]
> Reset search suggestions when activity is launched from a new intent
> 
> Review of attachment 8475514 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> I would probably make that comment a little more strongly worded. i.e.
> Something like "Suggestions won't update if we're not in edit mode." makes
> it clearer to me than "Reset the query after entering edit mode to update
> the suggestions appropriately."

Yeah, I don't love the way things like this are coupled right now :(

I also thought about making an explicit clearSuggestions method on SuggestionsFragment. Maybe that would be a better solution.
Updated the comment to be more explicit about the ordering.

Also, I looked into the logic for SuggestClient, and we don't perform a network request when there's an empty query; we just return an empty suggestion list. So I don't feel as bad about making this flow through the loadSuggestions code path.
Attachment #8475514 - Attachment is obsolete: true
Attachment #8475514 - Flags: review?(wjohnston)
Attachment #8476961 - Flags: review?(wjohnston)
Attachment #8476961 - Flags: review?(wjohnston) → review+
https://hg.mozilla.org/mozilla-central/rev/0654c821911a
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 34
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.