zefhemel/persistencejs — Issue #77: persistence.sync.server - Invalid value for argument: callback Value: undefined
Author: sergeibelov
Created: 2012-01-24 14:52:55+00:00
State: open

Node.js server with following code:

```javascript
var sys = require('sys');
var persistence = require('./persistence/persistence').persistence;
var persistenceStore = require('./persistence/persistence.store.mysql');
var persistenceSync = require('./persistence/persistence.sync.server');

var Task = persistence.define("Task", {
name: "TEXT",
done: "BOOL"
});

persistenceStore.config(persistence, 'localhost', 3306, 'tasks', 'root', 'pass');
persistenceSync.config(persistence);

var session = persistenceStore.getSession();
session.schemaSync();

var app = require('express').createServer();

app.get('/taskUpdates', function(req, res) {
persistenceSync.pushUpdates(req.conn, req.tx, Task, req.query.since, function(updates){
res.send(updates);
});
});

app.listen(8000);
console.log('Server running at http://localhost:8000/');
```

Throws the following error when http://localhost:8000/taskUpdates?since=1325375000 is loaded:

Error: Invalid value for argument: callback Value: undefined
at Object.getArgs (C:\tasks\persistence\persistence.js:2150:19)
at Observable.list (C:\tasks\persistence\persistence.store.sql.js:580:24)
at Object.pushUpdates (C:\tasks\persistence\persistence.sync.server.js:82:53)
at C:\tasks\tasks.js:20:19
at callbacks (C:\tasks\node_modules\express\lib\router\index.js:272:11)
at param (C:\tasks\node_modules\express\lib\router\index.js:246:11)
at pass (C:\tasks\node_modules\express\lib\router\index.js:253:5)
at Router._dispatch (C:\tasks\node_modules\express\lib\router\index.js:280:4)
at Object.handle (C:\tasks\node_modules\express\lib\router\index.js:45:10)
at next (C:\tasks\node_modules\express\node_modules\connect\lib\http.js:203:15)

Any insights are appreciated!