~knitzsche/scope-aggregator/fixes-fallback-bug-1599948

  • Committer: Kyle Nitzsche
  • Date: 2016-07-12 17:14:05 UTC
  • Revision ID: kyle.nitzsche@canonical.com-20160712171405-5evbnsfa9rlaxhsu
When testing photos scope I found an issue that this commit fixes.

Please review. The key change is line 1192.

DETAILS

The issue I noticed when testing this MP in photos-scope is that the art for 
Douban LOGIN result did not display in photos agg scope.  

I found that the fallback code (check_result_fallbacks()) was not called
for Duoban in the login case.

The general case I found is: For scopes that are declared in child_scopes.json
using the "scope" key, the check_results_callbacks() method was not called. 

(Please note that fallbacks code/feature is only currently implemented
for scopes that use a renderer defined in common_templates.)

Teseting. Modify photos scope child_scopes.json to only this for Duoban: 

        "scope": {
            "_category_title": "My Douban Photos",
            "id": "com.canonical.scopes.douban_doubanalbum",
            "local_id": "douban",
            "result_category_id_to_common_template": [
              {       
                "result_category_id": "login",
                "common_template": "not_logged_in"
              }       
            ],      
            "renderer_common_id": "normal_renderer"
        }       


This ^ means:
 *  if Douban result category is "login": use common_template "not logged_in".
    This template uses a fallback:
            "id": "not_logged_in",
            "fallbacks":
            [       
                {       
                    "key": "mascot",
                    "fields":
                    [       
                        {"field": "mascot"},
                        {"field": "art"}
                    ]       
                }       
            ],      
    [...]   
    Result is that Douban's login result which provides "art" is converted to
    "mascot".
* A result with any other category uses "normal_renderer". This does not use a
  fallback and expects the result to contain 'art".
Filename Latest Rev Last Changed Committer Comment Size
..
data 1 9 years ago Kyle Nitzsche init Diff
include 1 9 years ago Kyle Nitzsche init Diff
po 1 9 years ago Kyle Nitzsche init Diff
src 1 9 years ago Kyle Nitzsche init Diff
tests 1 9 years ago Kyle Nitzsche init Diff
.bzrignore 86.1.9 8 years ago Kyle Nitzsche keyword scopes now supported and placed in positio 794 bytes Diff Download File
4.8-rebase-local-hints-README.md 163.1.10 7 years ago Kyle Nitzsche fixed 4.8-rebase-local-hints-README.md doc per rev 12.8 KB Diff Download File
CMakeLists.txt 168 7 years ago Kyle Nitzsche fix fallback mechanism that all 2.9 KB Diff Download File
KNOWN_ISSUES.md 77 9 years ago Kyle Nitzsche doc formatting 476 bytes Diff Download File
manifest.json.in 5 9 years ago Kyle Nitzsche remove .application ref from manifest 388 bytes Diff Download File
README.md 162.1.9 7 years ago Kyle Nitzsche comprehensively tested features with permutations. 28.6 KB Diff Download File
security.json.in 1 9 years ago Kyle Nitzsche init 131 bytes Diff Download File