Skip to content

Instantly share code, notes, and snippets.

@svenfuchs
Created May 8, 2011 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save svenfuchs/961344 to your computer and use it in GitHub Desktop.
Save svenfuchs/961344 to your computer and use it in GitHub Desktop.
Travis CI Sproutcore spike progress.

This is fixed in 1.6beta (current master)

Demo: http://www.youtube.com/watch?v=qtN3h0cTiBE

When you go to http://travis-sproutcore.heroku.com/#!/svenfuchs/minimal and then click the "Build History" tab then you see 3 items even though a) the json response only contains 2 items and b) the tab controller's content property (i.e. the record array) also only contains 2 records.

My impression is that the following happens:

1. Going to http://travis-sproutcore.heroku.com/#!/svenfuchs/minimal (i.e. the "Current" tab) loads a single Build record using the data source's retrieveRecord() method. ~~2. Clicking on the "Build history" tab renders a template collection view which is bound to a record array which is populated via a query that has conditions that match the record loaded in 1). This query needs to be loaded from remote at this point. ~~ 3. While it loads the record array will contain the single record loaded in 1) and the view renders this item (Build #2 in the first row of the table). 4. Now the record array is updated with the new results from remote and it actually only contains 2 records afterwards. But the template collection view doesn't seem to remove its previously added first child item and thus now displays three items/rows.

This issue remains the same in 1.6beta (current master)

This issue seems to be fixed partly in 1.6beta (the screencasted click path now doesn't error any more) but partly remains (will post details soon) (False hope, i've had a portion of the template removed. Putting it back made the error return.)

Demo: http://www.youtube.com/watch?v=lwx28qJ69M4

When you go to http://travis-sproutcore.heroku.com/#!/josevalim/enginex you see the following error:

Uncaught TypeError: Cannot call method '$' of undefined
SC.TemplateCollectionView.SC.TemplateView.extend.arrayContentWillChange
SC.TemplateCollectionView.SC.TemplateView.extend._sctcv_contentDidChange
SC.Observable._notifyPropertyObservers
SC.Observable.propertyDidChange
SC.Observable.set
SC.CoreView.reopen._notifyWillDestroyLayer
SC.CoreView.reopen._notifyWillDestroyLayer
SC.CoreView.reopen._notifyWillDestroyLayer
SC.CoreView.reopen._notifyWillDestroyLayer
SC.CoreView.reopen._notifyWillDestroyLayer
SC.CoreView.reopen.destroyLayer
SC.CoreView.reopen._destroy
SC.CoreView.reopen.destroy
SC._BindableSpan.SC.TemplateView.extend.rerender
observer
SC._ChainObserver.propertyDidChange
SC._ChainObserver.objectDidChange
SC._ChainObserver.propertyDidChange
SC.Observable._notifyPropertyObservers
SC.Observable.allPropertiesDidChange
SC.ObjectController.SC.Controller.extend.contentPropertyDidChange
SC.ObjectController.SC.Controller.extend._scoc_observableContentDidChange
SC.Observable._notifyPropertyObservers
SC.Observable.propertyDidChange
SC.Observable.set
Travis.controllers.SC.Object.create.repository.SC.ObjectController.create.repositoryObservertravis.js:336
SC.Observable._notifyPropertyObservers
SC.Observable.allPropertiesDidChange
SC.ObjectController.SC.Controller.extend.contentPropertyDidChange
SC.ObjectController.SC.Controller.extend._scoc_observableContentDidChange
SC.Observable._notifyPropertyObservers
SC.Observable.propertyDidChange
SC.Observable.set
Travis.controllers.SC.Object.create.repository.SC.ObjectController.create.loadtravis.js:326
Travis.mainPane.SC.TemplatePane.append.layerIdtravis.js:6
SC.routes.SC.Object.create.trigger
SC.routes.SC.Object.create.locationDidChange
SC.Observable._notifyPropertyObservers
SC.Observable.propertyDidChange
SC.Observable.set
(anonymous function)
SC.run
SC.routes.SC.Object.create.hashChange
SC.mixin.handle
listener

This seems to happen in this line: https://github.com/sproutcore/sproutcore/blob/master/frameworks/core_foundation/views/template_collection.js#L143

The relevant template is here: matrix.handlebars

When I remove both #each helper blocks from this template (i.e. this one and this one) then the view renders fine.

When I just keep the first block but remove the second one then it seems to run into an endless loop and Chrome crashes the page after the timeout.

When I just keep the second block then I get the same error as above.

At this point, checking in the inspector console, the respective controller returns the following property values:

Travis.controllers.repository.tabs.current.get('content').get('configDimensions')
> ["Rvm"]

Travis.controllers.repository.tabs.current.getPath('content.matrix.firstObject.configValues')
> ["1.8.7]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment