Skip to content

[PB-6653] bugfix/Backup status can show as idle/cloud fetching while assets are still uploading - #552

Merged
CandelR merged 1 commit into
bugfix/photos-discovery-sqlite-racefrom
bugfix/PB-6653-incorrect-backup-status
Jul 30, 2026
Merged

[PB-6653] bugfix/Backup status can show as idle/cloud fetching while assets are still uploading#552
CandelR merged 1 commit into
bugfix/photos-discovery-sqlite-racefrom
bugfix/PB-6653-incorrect-backup-status

Conversation

@CandelR

@CandelR CandelR commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Fixes two backup reliability bugs: an incorrect "idle" status shown during an active upload, and edited photos silently losing their changes on retry.

Summary

  • src/store/slices/photos/index.ts: runDiscoveryThunk no longer overwrites the sync status with idle if an upload cycle is already running when it finishes.
  • thunks/upload.ts: runUploadThunk also dispatches uploading on its own reentrancy-guard skip path, as a second safeguard against the same race. buildUploadJobs now keys the existingRemoteFileId decision off remoteFileId presence instead of status, so a failed edit retry that falls to status='error' still replaces the existing Drive file instead of silently uploading (and keeping) the old, pre-edit version.
  • network/upload.ts: added a diagnostic warning when a file has a zero/invalid size before upload.

…t upload, and edited photos silently re-uploading as new

  files instead of replacing the synced version
@CandelR
CandelR requested a review from larryrider July 28, 2026 09:04
@CandelR CandelR self-assigned this Jul 28, 2026
@CandelR CandelR added the bug Something isn't working label Jul 28, 2026
@sonarqubecloud

Copy link
Copy Markdown

Comment thread src/network/upload.ts
const fileSize = stat.size;

if (fileSize <= 0) {
logger.warn(`[Upload] File "${filePath}" has invalid size=${fileSize} (stat: ${JSON.stringify(stat)})`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

if a file has an invalid size, shouldnt this function stop here or throw an error? instead of only log a warning 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Totally, but as we’re currently doing QA of this feature, I wanted to check the QA logs first and add this straight away to see what happens, and then we’ll decide which fix to apply :)

@CandelR
CandelR requested a review from larryrider July 28, 2026 12:38
@CandelR
CandelR merged commit d12311e into feature/PB-6068-photos-backup Jul 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants