Unreviewed fix after r182496 for when the cached runs JSON doesn't exist.
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Apr 2015 21:16:06 +0000 (21:16 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Apr 2015 21:16:06 +0000 (21:16 +0000)
* public/v2/app.js:
(App.Pane._fetch):
(App.Pane.refetchRuns):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182568 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/public/v2/app.js

index 727991e..20e094b 100644 (file)
@@ -1,3 +1,11 @@
+2015-04-08  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Unreviewed fix after r182496 for when the cached runs JSON doesn't exist.
+
+        * public/v2/app.js:
+        (App.Pane._fetch):
+        (App.Pane.refetchRuns):
+
 2015-04-07  Ryosuke Niwa  <rniwa@webkit.org>
 
         Perf dashboard should have a way of marking outliers
index 8202a5d..8df73b1 100755 (executable)
@@ -353,21 +353,24 @@ App.Pane = Ember.Object.extend({
             var useCache = true;
             App.Manifest.fetchRunsWithPlatformAndMetric(this.get('store'), platformId, metricId, null, useCache)
                 .then(function (result) {
-                    self._didFetchRuns(result);
-                    if (result.shouldRefetch)
-                        self.refetchRuns();
+                    if (result || result.shouldRefetch)
+                        self.refetchRuns(platformId, metricId);
+                    else
+                        self._didFetchRuns(result);
                 }, this._handleFetchErrors.bind(this, platformId, metricId));
             this.fetchAnalyticRanges();
         }
     }.observes('platformId', 'metricId').on('init'),
-    refetchRuns: function () {
-        var platform = this.get('platform');
-        var metric = this.get('metric');
-        Ember.assert('refetchRuns should be called only after platform and metric are resolved', platform && metric);
+    refetchRuns: function (platformId, metricId) {
+        if (!platformId)
+            platformId = this.get('platform').get('id');
+        if (!metricId)
+            metricId = this.get('metric').get('id');
+        Ember.assert('refetchRuns should be called only after platform and metric are resolved', platformId && metricId);
 
         var useCache = false;
-        App.Manifest.fetchRunsWithPlatformAndMetric(this.get('store'), platform.get('id'), metric.get('id'), null, useCache)
-            .then(this._didFetchRuns.bind(this), this._handleFetchErrors.bind(this, platform.get('id'), metric.get('id')));
+        App.Manifest.fetchRunsWithPlatformAndMetric(this.get('store'), platformId, metricId, null, useCache)
+            .then(this._didFetchRuns.bind(this), this._handleFetchErrors.bind(this, platformId, metricId));
     },
     _didFetchRuns: function (result)
     {