Make :sync() always add a "since" query parameter if available

...which ensures that multiple consecutive requests to /sync paginate
properly.
This commit is contained in:
Adrian Perez de Castro
2017-02-05 14:11:55 +01:00
parent be1ee939ee
commit 2946b55810

View File

@@ -435,7 +435,9 @@ function Client:_sync(options)
if not options then
options = {}
end
if not options.since then
options.since = self._sync_next_batch
end
self._log("sync: Requesting with next_batch = %s", options.since)
local response = self._api:sync(options)