iOS app locks out uploads when hashing fails - assets stuck in processing state indefinitely #8251

Open
opened 2026-02-05 13:37:22 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @davidaniva on GitHub (Jan 13, 2026).

The bug

When hashing fails for assets on iOS, they remain with NULL checksums in the database and are permanently stuck in "processing" state. The app shows "Hashing in progress" indefinitely and cannot upload these assets until manually rehashed.

Root cause analysis

  1. Hash failures leave NULL checksums (mobile/lib/domain/services/hash.service.dart:101-141)

    • Failed hashes are logged as warnings but assets are not marked as failed
    • Checksums remain NULL with no distinction between "never hashed" and "hash failed"
  2. NULL checksum = "processing" state (mobile/lib/infrastructure/repositories/backup.repository.dart:38-82)

    COUNT(*) FILTER (WHERE lae.checksum IS NULL) AS processing_count
    
    • Assets with NULL checksums count as "processing" forever
  3. No retry mechanism (mobile/ios/Runner/Sync/MessagesImpl.swift:270-379)

    • Swift hash function returns error but no retry logic exists
    • Background worker timeout is silently consumed (background_worker.service.dart:276)
  4. Upload requires hashed assets (backup.repository.dart:111-112)

    • getCandidates with onlyHashed=true skips NULL checksum assets
    • Failed assets never become upload candidates

Steps to reproduce

  1. Have assets that fail to hash (resource unavailable, permission issue, corrupt file)
  2. App attempts hash, fails, logs warning
  3. Assets remain with NULL checksum
  4. App shows perpetual "Hashing in progress"
  5. Upload never proceeds for these assets

Expected behavior

  • Failed hash attempts should be tracked separately from "pending" state
  • Retry logic with exponential backoff
  • User notification of failed assets
  • Ability to skip or manually retry failed assets

Suggested fixes

  1. Add hash_failed / hash_attempts columns to track failure state
  2. Implement retry logic with max attempts
  3. Distinguish UI between "processing", "failed", and "hashed"
  4. Add "Reset Hash Cache" or manual retry option

Workaround

Manually trigger rehash of photos to retry failed assets.

Platform

  • iOS mobile app
  • Affects: HashService, BackupRepository, BackgroundWorkerService
Originally created by @davidaniva on GitHub (Jan 13, 2026). ## The bug When hashing fails for assets on iOS, they remain with NULL checksums in the database and are permanently stuck in "processing" state. The app shows "Hashing in progress" indefinitely and cannot upload these assets until manually rehashed. ## Root cause analysis 1. **Hash failures leave NULL checksums** (`mobile/lib/domain/services/hash.service.dart:101-141`) - Failed hashes are logged as warnings but assets are not marked as failed - Checksums remain NULL with no distinction between "never hashed" and "hash failed" 2. **NULL checksum = "processing" state** (`mobile/lib/infrastructure/repositories/backup.repository.dart:38-82`) ```sql COUNT(*) FILTER (WHERE lae.checksum IS NULL) AS processing_count ``` - Assets with NULL checksums count as "processing" forever 3. **No retry mechanism** (`mobile/ios/Runner/Sync/MessagesImpl.swift:270-379`) - Swift hash function returns error but no retry logic exists - Background worker timeout is silently consumed (`background_worker.service.dart:276`) 4. **Upload requires hashed assets** (`backup.repository.dart:111-112`) - `getCandidates` with `onlyHashed=true` skips NULL checksum assets - Failed assets never become upload candidates ## Steps to reproduce 1. Have assets that fail to hash (resource unavailable, permission issue, corrupt file) 2. App attempts hash, fails, logs warning 3. Assets remain with NULL checksum 4. App shows perpetual "Hashing in progress" 5. Upload never proceeds for these assets ## Expected behavior - Failed hash attempts should be tracked separately from "pending" state - Retry logic with exponential backoff - User notification of failed assets - Ability to skip or manually retry failed assets ## Suggested fixes 1. Add `hash_failed` / `hash_attempts` columns to track failure state 2. Implement retry logic with max attempts 3. Distinguish UI between "processing", "failed", and "hashed" 4. Add "Reset Hash Cache" or manual retry option ## Workaround Manually trigger rehash of photos to retry failed assets. ## Platform - iOS mobile app - Affects: `HashService`, `BackupRepository`, `BackgroundWorkerService`
Author
Owner

@github-actions[bot] commented on GitHub (Jan 13, 2026):

This issue has automatically been closed as it is likely a duplicate. We get a lot of duplicate threads each day, which is why we ask you in the template to confirm that you searched for duplicates before opening one. If you're sure this is not a duplicate, please leave a comment and we will reopen the thread if necessary.

@github-actions[bot] commented on GitHub (Jan 13, 2026): This issue has automatically been closed as it is likely a duplicate. We get a lot of duplicate threads each day, which is why we ask you in the template to confirm that you searched for duplicates before opening one. If you're sure this is not a duplicate, please leave a comment and we will reopen the thread if necessary.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#8251