From 8111c1cc9ccacf8201fafd0dafd5b51e6235792b Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Sat, 25 Sep 2010 22:27:09 +1200 Subject: [PATCH] Return NULL if we got given a sync token we know nothing about. --- dba/caldav_functions.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dba/caldav_functions.sql b/dba/caldav_functions.sql index b12847ac..95921a6b 100644 --- a/dba/caldav_functions.sql +++ b/dba/caldav_functions.sql @@ -1213,7 +1213,8 @@ BEGIN AND sync_time > (SELECT modification_time FROM sync_tokens WHERE sync_token = in_old_sync_token) LIMIT 1; IF NOT FOUND THEN - RETURN in_old_sync_token; + -- They are in an inconsistent state: we return NULL so they can re-start the process + RETURN NULL; END IF; END IF; SELECT nextval('sync_tokens_sync_token_seq') INTO tmp_int;