You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by cl...@apache.org on 2017/05/04 11:54:06 UTC

zeppelin git commit: [ZEPPELIN-2452] Can not handle message in revision mode on web.

Repository: zeppelin
Updated Branches:
  refs/heads/master 92e3abc9d -> a231cf5dd


[ZEPPELIN-2452] Can not handle message in revision mode on web.

### What is this PR for?
Requests interpreter editor mode information in revision mode.
However, no information is needed in revision mode.
Produces misleading logs with misleading requests to the server.
```
ERROR [2017-04-26 18:07:48,718] ({qtp1273765644-60} NotebookServer.java[onMessage]:383) - Can't handle message
java.lang.NullPointerException
ERROR [2017-04-26 18:07:49,081] ({qtp1273765644-109} NotebookServer.java[onMessage]:383) - Can't handle message
java.lang.NullPointerException
ERROR [2017-04-26 18:07:49,083] ({qtp1273765644-14} NotebookServer.java[onMessage]:383) - Can't handle message
java.lang.NullPointerException
```

This log is requested as many as the number of paragraphs contained in the note.

### What type of PR is it?
Bug fix

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-2452

### How should this be tested?
1. Create a git-repo based note. (Supported by default)
2. Modify the paragraph and commit.
3. Go to the committed revision.
4. Reload the page.
5. Check the server logs.

```
NotebookServer.java[onMessage]:383) - Can't handle message
java.lang.NullPointerException
```

### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Author: CloverHearts <cl...@gmail.com>

Closes #2289 from cloverhearts/fix/incorrectcall-geteditorsetting-on-revisionmode and squashes the following commits:

4b19fb0d [CloverHearts] fix indent
8c77f769 [CloverHearts] fix call geteditorsetting


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/a231cf5d
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/a231cf5d
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/a231cf5d

Branch: refs/heads/master
Commit: a231cf5ddc17ea8a849315be6e0c2e6c0e08b7fc
Parents: 92e3abc
Author: CloverHearts <cl...@gmail.com>
Authored: Fri Apr 28 12:01:54 2017 +0900
Committer: CloverHearts <cl...@gmail.com>
Committed: Thu May 4 20:53:58 2017 +0900

----------------------------------------------------------------------
 .../app/notebook/paragraph/paragraph.controller.js    | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/a231cf5d/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
index 044d9b8..3dcc4ed 100644
--- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
+++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
@@ -848,14 +848,16 @@ function ParagraphCtrl ($scope, $rootScope, $route, $window, $routeParams, $loca
 
   let getEditorSetting = function (paragraph, interpreterName) {
     let deferred = $q.defer()
-    websocketMsgSrv.getEditorSetting(paragraph.id, interpreterName)
-    $timeout(
-      $scope.$on('editorSetting', function (event, data) {
-        if (paragraph.id === data.paragraphId) {
-          deferred.resolve(data)
+    if (!$scope.revisionView) {
+      websocketMsgSrv.getEditorSetting(paragraph.id, interpreterName)
+      $timeout(
+        $scope.$on('editorSetting', function (event, data) {
+          if (paragraph.id === data.paragraphId) {
+            deferred.resolve(data)
+          }
         }
-      }
       ), 1000)
+    }
     return deferred.promise
   }