Bug 1056490 - Fixes addons.repository WARN Unknown type id when parsing addon: 5. r=Irving
authorSudheesh Singanamalla <sudheesh1995@yahoo.com>
Mon, 08 Sep 2014 21:55:21 +0530
changeset 204585 4b0ba1775012f924f5ac645ff35cf286fdb89a97
parent 204584 5447d42b9bf543b150c5173b9b939c6b1eba9ba8
child 204586 e7bc94d454eea8be083bb23acb3ac778fb59e9a6
push id27462
push userryanvm@gmail.com
push dateWed, 10 Sep 2014 22:20:58 +0000
treeherdermozilla-central@bad6a9fc2bf0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIrving
bugs1056490
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1056490 - Fixes addons.repository WARN Unknown type id when parsing addon: 5. r=Irving
toolkit/mozapps/extensions/internal/AddonRepository.jsm
--- a/toolkit/mozapps/extensions/internal/AddonRepository.jsm
+++ b/toolkit/mozapps/extensions/internal/AddonRepository.jsm
@@ -1067,29 +1067,52 @@ this.AddonRepository = {
           addon[INTEGER_KEY_MAP[localName]] = value;
         continue;
       }
 
       // Handle cases that aren't as simple as grabbing the text content
       switch (localName) {
         case "type":
           // Map AMO's type id to corresponding string
+          // https://github.com/mozilla/olympia/blob/master/apps/constants/base.py#L127
+          // These definitions need to be updated whenever AMO adds a new type.
           let id = parseInt(node.getAttribute("id"));
           switch (id) {
             case 1:
               addon.type = "extension";
               break;
             case 2:
               addon.type = "theme";
               break;
             case 3:
               addon.type = "dictionary";
               break;
+            case 4:
+              addon.type = "search";
+              break;
+            case 5:
+              addon.type = "langpack";
+              break;
+            case 6:
+              addon.type = "langpack-addon";
+              break;
+            case 7:
+              addon.type = "plugin";
+              break;
+            case 8:
+              addon.type = "api";
+              break;
+            case 9:
+              addon.type = "lightweight-theme";
+              break;
+            case 11:
+              addon.type = "webapp";
+              break;
             default:
-              logger.warn("Unknown type id when parsing addon: " + id);
+              logger.info("Unknown type id " + id + " found when parsing response for GUID " + guid);
           }
           break;
         case "authors":
           let authorNodes = node.getElementsByTagName("author");
           for (let authorNode of authorNodes) {
             let name = self._getDescendantTextContent(authorNode, "name");
             let link = self._getDescendantTextContent(authorNode, "link");
             if (name == null || link == null)