tmeasday / meteor-router

MIT License
366 stars 76 forks source link

beforeRouting being called on method calls #112

Open svasva opened 11 years ago

svasva commented 11 years ago

this is a huge issue since it was intended to reset session stuff on a page change, but method calls on the same page making that page to be reset while not navigating away from it :(

tmeasday commented 11 years ago

Can you provide a reproduction of this one?

svasva commented 11 years ago

Disregard this. Was my own fault - just found that using reactive data sources in routing functions is a bad idea :D

svasva commented 11 years ago

I've found out what exactly causes that. A filter that calls Meteor.user() to check if user was logged in calls beforeRouting each time user record gets a change (in my case users are getting alot of changes in their profile). I guess we could change it to run beforeRouting after all filters have been passed, just before actually changing a page. And definitely don't call it if page remains the same. Any ideas?

svasva commented 11 years ago

check https://github.com/tmeasday/meteor-router/pull/117