Scopes scope is reordering results sent by the server
Bug #1312887 reported by
Roberto Alsina
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Unity Scopes Scope |
Fix Released
|
Critical
|
James Henstridge | ||
unity-scope-scopes (Ubuntu) |
Fix Released
|
Critical
|
James Henstridge |
Bug Description
It's showing the actual scopes recommendations, which are the most important results, at the end, below "related searches", when the server is actually sending them first.
Related branches
lp:~jamesh/unity-scope-scopes/result-ordering
- Paweł Stołowski (community): Approve
-
Diff: 65 lines (+18/-9)1 file modifiedsrc/scopes-scope.cpp (+18/-9)
lp:~jamesh/unity-scope-scopes/result-ordering2
- Michal Hruby (community): Approve
- Facundo Batista (community): Approve
-
Diff: 275 lines (+65/-84)2 files modifiedsrc/scopes-scope.cpp (+64/-83)
src/scopes-scope.h (+1/-1)
tags: | added: s-s-scopes |
Changed in unity-scope-scopes: | |
assignee: | nobody → James Henstridge (jamesh) |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in unity-scope-scopes: | |
importance: | High → Critical |
Changed in unity-scope-scopes (Ubuntu): | |
importance: | High → Critical |
Changed in unity-scope-scopes: | |
status: | Triaged → Fix Released |
Changed in unity-scope-scopes (Ubuntu): | |
assignee: | nobody → James Henstridge (jamesh) |
To post a comment you must log in.
So the execution flow when processing a search in the scope goes something like this:
1. issue the query to the remote scopes scope, with a time limit of 1 second.
2. If the remote scope answers in that time, iterate through the results and:
- if the result is in the "recommendations" category, save it in recommended_scopes
- otherwise, push it out immediately.
3. Iterate through the local scopes, and push a result if (a) the name matches, (b) the description matches, or (c) there was a recommendation for the scope. In case (c), all recommendations for the scope are pushed.
4. If the online scope did not return results in the 1 second time limit, wait for it to complete now.
5. Now perform the equivalent of (2) and (3) but ignore recommendations for scopes that have already been pushed out.
It looks like we can get the desired behaviour by saving the non-recommendations results from (2) and pushing them to the shell after (3), and do something similar in (5).