Skip to content

Conversation

@prateekmedia
Copy link
Member

Description

Tests

prateekmedia and others added 5 commits December 4, 2025 12:48
Add DeviceFolderSelectionCache to track selected backup folders and
properly handle the case when a folder is deselected while uploads are
in progress. This prevents files from getting stuck in an inconsistent
state by cleaning up pending uploads and database entries when their
source folder is no longer selected for backup.
- Add isAutoSync flag to FileUploadItem to distinguish auto-sync from manual uploads
- Only apply only-new filter and folder deselection checks to auto-sync uploads
- Manual uploads (retries, explicit adds) now bypass these filters
- Remove dependency on enableBackupFolderSync for only-new filter
- Move threshold cleanup off UI critical path with fire-and-forget pattern
- Extract _cleanupPendingUpload helper to reduce duplication
- Fix race condition in _pollQueue by marking entries in-progress before await

Co-authored-by: Claude <[email protected]>
…nt patterns

- Remove duplicate folder deselection and only-new checks from _encryptAndUploadFileToCollection
  (already handled in _pollQueue before calling)
- Simplify removeFromQueueWhere to use _removeAndSkip for all cases
- Use consistent unawaited(_pollQueue()) pattern everywhere

Co-authored-by: Claude <[email protected]>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@prateekmedia prateekmedia marked this pull request as draft December 8, 2025 09:51
@prateekmedia prateekmedia marked this pull request as ready for review December 8, 2025 09:51
@prateekmedia prateekmedia marked this pull request as draft December 8, 2025 12:26
@prateekmedia prateekmedia marked this pull request as ready for review December 8, 2025 15:40
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@prateekmedia prateekmedia marked this pull request as draft December 8, 2025 17:10
@prateekmedia prateekmedia marked this pull request as ready for review December 8, 2025 17:10
@prateekmedia
Copy link
Member Author

@ua741 can you review?

@prateekmedia prateekmedia marked this pull request as draft December 9, 2025 14:15
@prateekmedia prateekmedia marked this pull request as ready for review December 9, 2025 14:15
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 515 to 518
for (EnteFile pendingUpload in pendingUploads) {
if (localIDsInOtherFileEntries.contains(pendingUpload.localID)) {
entriesToDelete.add(pendingUpload.generatedID!);
} else {
pendingUpload.collectionID = null;
entriesToUpdate.add(pendingUpload);
if (pendingUpload.queueSource == null ||
pendingUpload.queueSource == manualQueueSource) {
continue;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Cancel deselected backups even when queueSource is null

When a user deselects a device folder, removeFilesQueuedForUpload now skips any pending upload whose queueSource is null or manual. The new queue_source column is added in this commit but never backfilled, so all already-queued auto-backup entries have queueSource == null. As a result, turning off a folder no longer removes those queued uploads—they remain in the DB/queue and continue uploading despite the folder being deselected. The cleanup path should handle preexisting rows without a queueSource (or backfill them) so deselection reliably cancels pending uploads.

Useful? React with 👍 / 👎.

@prateekmedia prateekmedia marked this pull request as draft December 18, 2025 09:05
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.

1 participant