Skip to content

Commit

Permalink
refactor: remove redundant edge case handling in Google Drive service…
Browse files Browse the repository at this point in the history
…s (for changes api)
  • Loading branch information
amuwal committed Dec 24, 2024
1 parent e101198 commit 11ee725
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,15 +289,6 @@ export class GoogleDriveService implements IFileService {
pageToken = nextPageToken;
newRemoteCursor = newStartPageToken || nextPageToken;
apiCallCount++;

if (nextPageToken && changes.length === 0) {
// edge case where we have no changes but still have a nextPageToken
return {
filesToSync,
moreChangesToFetch: false,
remote_cursor: newRemoteCursor,
};
}
} while (pageToken && apiCallCount < maxApiCalls);

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,11 +730,6 @@ export class GoogleDriveFolderService implements IFolderService {
'nextPageToken, newStartPageToken, changes(file(id,name,mimeType,createdTime,modifiedTime,size,parents,webViewLink,driveId,trashed,permissionIds))',
});

if (!response.data.changes.length) {
// edge case where we have no changes but still have a nextPageToken
break;
}

const batchFolders = response.data.changes
.filter(
(change) =>
Expand Down

0 comments on commit 11ee725

Please sign in to comment.