Fix crash when the delta link is expired

This commit is contained in:
skilion 2018-02-18 18:02:38 +01:00
parent d9a5d1b3b9
commit 008a5756b3
2 changed files with 7 additions and 2 deletions

View file

@ -3,6 +3,10 @@
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Fixed
- Crash when the delta link is expired
## [1.1.1] - 2018-01-20
### Fixed
- Wrong regex for parsing authentication uri

View file

@ -160,7 +160,7 @@ final class SyncEngine
JSONValue changes;
string deltaLink = itemdb.getDeltaLink(driveId, id);
log.vlog("Applying changes of " ~ id);
do {
for (;;) {
try {
changes = onedrive.viewChangesById(driveId, id, deltaLink);
} catch (OneDriveException e) {
@ -181,7 +181,8 @@ final class SyncEngine
if ("@odata.deltaLink" in changes) deltaLink = changes["@odata.deltaLink"].str;
if (deltaLink) itemdb.setDeltaLink(driveId, id, deltaLink);
if ("@odata.nextLink" in changes) deltaLink = changes["@odata.nextLink"].str;
} while ("@odata.nextLink" in changes);
else break;
}
// delete items in idsToDelete
if (idsToDelete.length > 0) deleteItems();