Changeset 217230 in webkit


Ignore:
Timestamp:
May 22, 2017 11:29:05 AM (7 years ago)
Author:
Dewei Zhu
Message:

Fix the bug that sometimes analysis task results pane is missing.
https://bugs.webkit.org/show_bug.cgi?id=172404

Reviewed by Ryosuke Niwa.

AnalysisTaskPage._didFetchTask and AnalaysisTaskPage._fetchRelatedInfoForTaskId should be called in order.
The race between those two functions causes the analysis task results pane sometimes missing.

  • public/v3/components/analysis-results-viewer.js:

(AnalysisResultsViewer.prototype.render): Fix the bug in r217173 that commitSet can be undefined.

  • public/v3/pages/analysis-task-page.js:

(AnalysisTaskPage.prototype.updateFromSerializedState): Use arrow function to get rid of self variable.
Use const instead of var for constant variable. And call _didFetchTask before calling _fetchRelatedInfoForTaskId.
(AnalysisTaskPage.prototype._renderTaskNameAndStatus):
(AnalysisTaskPage.cssTemplate):

Location:
trunk/Websites/perf.webkit.org
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Websites/perf.webkit.org/ChangeLog

    r217173 r217230  
     12017-05-22  Dewei Zhu  <dewei_zhu@apple.com>
     2
     3        Fix the bug that sometimes analysis task results pane is missing.
     4        https://bugs.webkit.org/show_bug.cgi?id=172404
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        AnalysisTaskPage._didFetchTask and AnalaysisTaskPage._fetchRelatedInfoForTaskId should be called in order.
     9        The race between those two functions causes the analysis task results pane sometimes missing.
     10
     11        * public/v3/components/analysis-results-viewer.js:
     12        (AnalysisResultsViewer.prototype.render): Fix the bug in r217173 that commitSet can be undefined.
     13        * public/v3/pages/analysis-task-page.js:
     14        (AnalysisTaskPage.prototype.updateFromSerializedState): Use arrow function to get rid of self variable.
     15        Use `const` instead of var for constant variable. And call _didFetchTask before calling _fetchRelatedInfoForTaskId.
     16        (AnalysisTaskPage.prototype._renderTaskNameAndStatus):
     17        (AnalysisTaskPage.cssTemplate):
     18
    1192017-05-19  Ryosuke Niwa  <rniwa@webkit.org>
    220
  • trunk/Websites/perf.webkit.org/public/v3/components/analysis-results-viewer.js

    r217173 r217230  
    6363        for (const label of this._rangeSelectorLabels) {
    6464            const commitSet = this._selectedRange[label];
     65            if (!commitSet)
     66                continue;
    6567            const list = this._selectorRadioButtonList[label] || [];
    6668            for (const item of list) {
  • trunk/Websites/perf.webkit.org/public/v3/pages/analysis-task-page.js

    r217173 r217230  
    223223        super.render();
    224224    }
    225    
     225
    226226    static htmlTemplate()
    227227    {
     
    466466    updateFromSerializedState(state)
    467467    {
    468         var self = this;
    469468        if (state.remainingRoute) {
    470             var taskId = parseInt(state.remainingRoute);
    471             AnalysisTask.fetchById(taskId).then(this._didFetchTask.bind(this), function (error) {
    472                 self._errorMessage = `Failed to fetch the analysis task ${state.remainingRoute}: ${error}`;
    473                 self.enqueueToRender();
     469            const taskId = parseInt(state.remainingRoute);
     470            AnalysisTask.fetchById(taskId).then(this._didFetchTask.bind(this)).then(() => {
     471                this._fetchRelatedInfoForTaskId(taskId);
     472            }, (error) => {
     473                this._errorMessage = `Failed to fetch the analysis task ${state.remainingRoute}: ${error}`;
     474                this.enqueueToRender();
    474475            });
    475             this._fetchRelatedInfoForTaskId(taskId);
    476476        } else if (state.buildRequest) {
    477             var buildRequestId = parseInt(state.buildRequest);
    478             AnalysisTask.fetchByBuildRequestId(buildRequestId).then(this._didFetchTask.bind(this)).then(function (task) {
    479                 self._fetchRelatedInfoForTaskId(task.id());
    480             }, function (error) {
    481                 self._errorMessage = `Failed to fetch the analysis task for the build request ${buildRequestId}: ${error}`;
    482                 self.enqueueToRender();
     477            const buildRequestId = parseInt(state.buildRequest);
     478            AnalysisTask.fetchByBuildRequestId(buildRequestId).then(this._didFetchTask.bind(this)).then((task) => {
     479                this._fetchRelatedInfoForTaskId(task.id());
     480            }, (error) => {
     481                this._errorMessage = `Failed to fetch the analysis task for the build request ${buildRequestId}: ${error}`;
     482                this.enqueueToRender();
    483483            });
    484484        }
     
    648648            const metric = task.metric();
    649649            const subtitle = `${metric.fullName()} on ${platform.label()}`;
    650             this.renderReplace(this.content('platform-metric-names'), 
     650            this.renderReplace(this.content('platform-metric-names'),
    651651                link(subtitle, this.router().url('charts', ChartsPage.createStateForAnalysisTask(task))));
    652652        }
     
    958958                border-bottom: solid 1px #ccc;
    959959            }
    960            
     960
    961961            #results-pane {
    962962                margin-top: 1rem;
Note: See TracChangeset for help on using the changeset viewer.