Skip to content

Add cursor-based sync endpoints for files and folders - #48

Merged
patricioxavier8 merged 3 commits into
mainfrom
feature/cursor-sync-endpoints
Sep 21, 2026
Merged

patricioxavier8 merged 3 commits into
mainfrom
feature/cursor-sync-endpoints

Conversation

@patricioxavier8

Copy link
Copy Markdown
Contributor

Adds data models and API methods to support cursor-based incremental synchronization (GET /files/sync and GET /folders/sync), replacing the legacy offset/bucket pagination that caused high database CPU usage.

Changes

  • DriveTypes.swift:
    • Added SyncedFile and GetFilesSyncResponse.
    • Added SyncedFolder and GetFoldersSyncResponse.
    • Included optional database fields (id, parentId, folderId, name, plainName, status, updatedAt, createdAt).
  • DriveAPI.swift:
    • Implemented getFilesSync(updatedAt:cursor:limit:status:debug:).
    • Implemented getFoldersSync(updatedAt:cursor:limit:status:debug:).
    • Properly encodes cursor query parameters.

- Add SyncedFile, SyncedFolder, GetFilesSyncResponse, and GetFoldersSyncResponse models.
- Support database entity fields (id, parentId, folderId, plainName, status, etc.).
- Add getFilesSync and getFoldersSync methods to DriveAPI using cursor-based pagination.
- Remove dependency on offset and bucket filtering for change enumeration.
@patricioxavier8
patricioxavier8 merged commit 0d91cf6 into main Sep 21, 2026
1 check passed
@patricioxavier8
patricioxavier8 deleted the feature/cursor-sync-endpoints branch September 21, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants