lindleycb / meteor-stale-session

Stale session and session timeout handling for meteorjs
MIT License
40 stars 20 forks source link

Add support for Meteor 0.7.x. #3

Closed rgould closed 10 years ago

rgould commented 10 years ago

Heya! I wanted to use this in our project, but it took a bit of work to get it working properly with Meteor 0.7.0.1. The biggest problem was that the heartbeat interval would try to hook itself up before the client had received Meteor.settings.

As a bit of a bonus I centralized the config defaults into config.js, but that required a bit more refactoring (notably wrapping things in Meteor.startup to give the user apps a chance to configure things first).

Criticisms welcome!

Here's the summary:

lindleycb commented 10 years ago

Hi Richard,

Apologies for the delays in replying to this. I've not had time to investigate fully but I wonder whether the timing problems you were seeing were down to the way you were loading the settings - were you relying on the file load order?

I've been using this on a number of projects running 0.7.x and haven't noticed any problems - the timeouts seem to be working normally (but I haven't run extensive tests).

When running Meteor I use a technique similar to the one outlined by Chris Mather here: https://www.eventedmind.com/tracks/feed-archive/organizing-environment-variables-and-settings which I suspect means that the settings are in place before the files are loaded.

If that's the cause of the issue, then perhaps a change to the documentation rather than the code may be what's required.

Can you let me know if putting the settings in this way would solve the problem for you without requiring the extensive code changes?

Chris

rgould commented 10 years ago

@lindleycb You're right! Totally missed that bit about meteor settings somewhere. I adjusted our code to use config/settings.json and it works well. I would suggest that we update the documentation, so someone else who hasn't seen heard about those Meteor settings doesn't get bit by this as well. I'll issue another PR.