couchbaselabs / cbft

*THIS PROJECT HAS MOVED* from couchbaselabs TO: https://github.com/couchbase/cbft -- no further development will be done here on couchbaselabs/cbft
Other
27 stars 5 forks source link

seeing error text and unprocessed template text #147

Closed mschoch closed 9 years ago

mschoch commented 9 years ago

I just got the latest cbft, built it, and launched it (with new data dir). I got the welcome page, pressed the button for a new index and see the following problems:

  1. Breadcrumbs are:

    Indexes / {{newIndexName}} / New Index

  2. Red error message box is visible and contains the text: {{errorMessage}}
  3. Index Name field shows the text {{newIndexName}} before the input widget

Possibly related, the javascript console contains:

TypeError: Cannot read property 'indexDefs' of null
    at index.js:17
    at angular.js:8005
    at wrappedCallback (angular.js:11446)
    at wrappedCallback (angular.js:11446)
    at angular.js:11532
    at Scope.$eval (angular.js:12556)
    at Scope.$digest (angular.js:12368)
    at Scope.$apply (angular.js:12660)
    at done (angular.js:8272)
    at completeRequest (angular.js:8477)(anonymous function) @ angular.js:9937
angular.js:9937 TypeError: Cannot read property 'planParams' of undefined
    at new IndexNewCtrl (http://localhost:8095/static/js/index.js:404:41)
    at invoke (http://localhost:8095/static/lib/angular/angular.js:3906:17)
    at Object.instantiate (http://localhost:8095/static/lib/angular/angular.js:3917:23)
    at http://localhost:8095/static/lib/angular/angular.js:7201:28
    at link (http://localhost:8095/static/lib/angular-route/angular-route.js:913:26)
    at nodeLinkFn (http://localhost:8095/static/lib/angular/angular.js:6633:13)
    at compositeLinkFn (http://localhost:8095/static/lib/angular/angular.js:6028:13)
    at publicLinkFn (http://localhost:8095/static/lib/angular/angular.js:5923:30)
    at boundTranscludeFn (http://localhost:8095/static/lib/angular/angular.js:6048:21)
    at controllersBoundTransclude (http://localhost:8095/static/lib/angular/angular.js:6654:18) <div ng-view="" class="ng-scope">
mschoch commented 9 years ago

cbft

steveyen commented 9 years ago

Looks like an optimization I made awhile back introduced a race condition. Previously, the code used to load metadata (like the list of available index types and source types) on-demand, late-binding when it needed to populate controls and dropdowns (such as in New Index form).

Nowadays, though, the metadata gets retrieved just once into a global, during start of the client-side...

https://github.com/couchbaselabs/cbft/blob/master/static/js/controllers.js#L15

Need to think of how to sequence this, or maybe have some ways timeout/refresh itself if metadata ain't ready yet.

steveyen commented 9 years ago

As a quick thing, I just added some checks to display nothing instead of template placeholders.

steveyen commented 9 years ago

I think this got fixed right before 0.1.0 Developer Preview 1 with this commit 3a440cc8376f57