Skip to content

Instantly share code, notes, and snippets.

@whmountains
whmountains / description.markdown
Last active August 29, 2015 14:07
Problems with Tracker.autorun()

I'm trying to write a radio automation app. The version that has to do with this gist is hosted at feathercaster-3e3055d.meteor.com

Pane one shows files and folders. That's irrelevant to the problem.

Pane two shows the contents of the currently open playlist. The toolbar at the top has a playlist switcher. When the user clicks on the dropdown to change the playlist, it fires the event listener located in playlistToolbar.js at line 72. That in turn update the openPlaylistID session variable like this: Session.set('openPlaylistID', playlistID);

I've got a Tracker.autorun() function in playlists.js:23 whose very first line is var openPlaylistID = Session.get('openPlaylistID'); I would expect that the computation would automatically be invalidated and re-run every time the Session variable is changed. That's how things used to work, but I've changed something (I don't know what.), and now that computation never gets re-run. At least, I assume so since