quirkey/sammy — Issue #114: before() filter appears to destroy routes
Author: torm3nt
Created: 2011-10-20 21:36:01+00:00
State: open

When adding a before filter, like below:

// add event listener for google maps movement, but only on the home screen
this.before('#/', function(callback){
// we only add this listener to the homepage
AppMap.listeners.home = google.maps.event.addListener(AppMap.map, 'bounds_changed', function() {
// we don't want to overload the server with queries, so set a timeout of 0.2 secs before
// executing the query. If another request comes through before that time, start again.
clearTimeout(AppMap.geospatialTimeout);
AppMap.geospatialTimeout = setTimeout(function() { AppMap.loadShopsWithinBoundary() }, 200);
});
});

My routes are suddenly unable to respond (sammy constantly reports a 500 error). This is a sammy 500, not a server 500. Am I doing something wrong or is there an issue here?