Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-50656

[Eventing] [UI] Parse error & expansion inside of JavaScript comments

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 7.1.0
    • 7.1.0
    • eventing
    • Untriaged
    • 1
    • Yes

    Description

      I noticed that an Eventing function with lots of comments (where the function was made in a 6.6.5 GA version) when imported via the REST API seemed to "gum" up the UI for Eventing making that view non-functional (the target UI with the issue was a recent build Enterprise Edition 7.1.0 build 2175).   Note 7.0.3 GA works fine.

      I had to use "cbevent -user Administrator -password password -flush -host http://localhost:8091" to get the Eventing portion of the UI unstuck.

      Tracking things down it appears that the Function parser is not happy with some text in  /* .... */ c-style comments. 

       

      The following Eventing Function "f_issue_a.json" can be imported BUT it can not be exported

      /*
      evtest0::%id%
      */
      function OnUpdate(doc, meta) {
      }
      

       

      Note if we drop a '%' character from within the above comment I can perform an export "f_issue_a(1).json" but some funny stuff happens in side to comment.

      /*
      evtest0::%id
      */
      function OnUpdate(doc, meta) {
      }
      

      however in the second case the saved JSON payload in the file system from an export appears very odd insertion of text.

      [{"appcode":"/*\nevtest0::%!i(MISSING)d\n*/\n\nfunction OnUpdate(doc, meta)

      And when I import the exported function  "f_issue_a(1).json" then rename it to f_issue_b in the settings I get the following

       

      /*
      evtest0::%!i(MISSING)d
      */
      function OnUpdate(doc, meta) {
      }
      

       

      Attachments

        1. f_issue_a.json
          0.9 kB
        2. f_issue_a (1).json
          0.9 kB
        3. UI_console_error_log.log
          9 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sujay.gad Sujay Gad
            jon.strabala Jon Strabala
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty