lower lastSyncedPull if server max sync ID is lower

This commit is contained in:
azivner
2019-01-04 18:58:46 +01:00
parent c3913a8735
commit 0be173a8f7
2 changed files with 13 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ const appInfo = require('../../services/app_info');
const eventService = require('../../services/events');
const cls = require('../../services/cls');
const sqlInit = require('../../services/sql_init');
const sql = require('../../services/sql');
async function loginSync(req) {
if (!await sqlInit.schemaExists()) {
@@ -44,7 +45,8 @@ async function loginSync(req) {
req.session.loggedIn = true;
return {
sourceId: sourceIdService.getCurrentSourceId()
sourceId: sourceIdService.getCurrentSourceId(),
maxSyncId: await sql.getValue("SELECT MAX(id) FROM sync")
};
}