meteor / postgres-packages

Early preview of PostgreSQL support for Meteor (deprecated, here for historical reasons)
http://meteor-postgres.readthedocs.org/
158 stars 25 forks source link

Exception in setInterval callback: #26

Open marcmunro opened 8 years ago

marcmunro commented 8 years ago

This happens from the publish-relation example. This is cloned from github (commit 9806ece996c31884db27448f21ed963faf237da7) with modifications only to the environment variable settings in run-app.sh to attach to a suitable database (export POSTGRESQL_URL="postgres://localhost:5437/publish_relation").

From the brower I have created an account and made a single post.

I then restart the app and leave it alone. Eventually, the error occurs.

Here is the log:

I20150923-13:23:33.284(-7)? Exception in setInterval callback: TypeError: Cannot call method 'update' of undefined
I20150923-13:23:33.285(-7)?     at AccountsServ    I20150923-13:23:33.284(-7)? Exception in setInterval callback: TypeError: Cannot call method 'update' of undefined
I20150923-13:23:33.285(-7)?     at AccountsServer.Ap._expireTokens (packages/accounts-base/accounts_server.js:1086:1)
I20150923-13:23:33.285(-7)?     at packages/accounts-base/accounts_server.js:1124:1
I20150923-13:23:33.285(-7)?     at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)
I20150923-13:23:33.285(-7)?     at packages/meteor/timers.js:6:1
I20150923-13:23:33.286(-7)?     at runWithEnvironment (packages/meteor/dynamics_nodejs.js:108:1)

er.Ap._expireTokens (packages/accounts-base/accounts_server.js:1086:1) I20150923-13:23:33.285(-7)? at packages/accounts-base/accountsserver.js:1124:1 I20150923-13:23:33.285(-7)? at [object Object]..extend.withValue (packages/meteor/dynamics_nodejs.js:56:1) I20150923-13:23:33.285(-7)? at packages/meteor/timers.js:6:1 I20150923-13:23:33.286(-7)? at runWithEnvironment (packages/meteor/dynamics_nodejs.js:108:1)

Slava commented 8 years ago

@stubailo is it the token clean-up code from the accounts fork?

stubailo commented 8 years ago

Yep! Didn't implement this

marcmunro commented 8 years ago

Will you be implementing it? If not, can you tell me what needs to be done?

stubailo commented 8 years ago

Basically we need to add a method to the Accounts DB driver to remove all expired tokens, and call that within a setInterval in the accounts server code in _expireTokens.

marcmunro commented 8 years ago

Is anyone going to be doing that any time soon, or do I need to hack on that myself? I don't mind, just don't want to duplicate effort.

stubailo commented 8 years ago

I don't have any plan to do it at the moment - my main goal was to get a demo working ASAP, so I didn't put in that much effort into making the accounts package complete.

marcmunro commented 8 years ago

ok, thx. Do you mind if I keep this item open so that I can ask questions if need to? I'll try not to bother you much and it will probably be a few days before I get to that point.

stubailo commented 8 years ago

Yeah no problem - there's a real bug, so there should be an open issue!

rclai commented 8 years ago

Was this fixed by #18? Or is it totally unrelated?

stubailo commented 8 years ago

It could be - I am not currently using Postgres for anything, so hopefully someone else can tell us if it is fixed now!

marcmunro commented 8 years ago

I cannot tell if it fixes anything due to issue #32. If that gets resolved, I will take another look.

stubailo commented 8 years ago

@marcmunro sorry that broke things for you! I'll take a look.