immich/mobile/lib/infrastructure
shenlong 9fa8de7baa
feat: add cloud id during native sync (#20418)
* use adjustment time in iOS for hash reset

# Conflicts:
#	mobile/lib/infrastructure/repositories/local_album.repository.dart
#	mobile/lib/presentation/pages/drift_asset_troubleshoot.page.dart

* migration

* feat: sync cloudId and eTag on sync

* fixes fixes

* more fixes

* re-sync updated eTags

* add server version check & auto sync cloud ids on compatible servers

* fix test

* remove button from sync status page

* chore: modify for testing

* more changes

* chore: add commas in toString

* use cached provider in splash screen

* read upload service provider to prevent reset

* log errors from fetching cloud id mapping

* WIP: migrate cloud id - debug log

* ignore locked asset update

* bulk update metadata

* change log text

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
Co-authored-by: Alex <alex.tran1502@gmail.com>
2026-01-14 12:34:11 -06:00
..

Infrastructure Layer

This directory contains the infrastructure layer of Immich. The infrastructure layer is responsible for the implementation details of the app. It includes data sources, APIs, and other external dependencies.

Structure

  • Entities: These are the classes that define the database schema for the domain models.
  • Repositories: These are the actual implementation of the domain interfaces. A single interface might have multiple implementations.
  • Utils: These are utility classes and functions specific to infrastructure implementations.
infrastructure/
├── entities/
│   └── user.entity.dart
├── repositories/
│   └── user.repository.dart
└── utils/
    └── database_utils.dart

Usage

The infrastructure layer provides concrete implementations of repository interfaces defined in the domain layer. These implementations are exposed through Riverpod providers in the root providers directory.

// In domain/services/user.service.dart
final userRepository = ref.watch(userRepositoryProvider);
final user = await userRepository.getUser(userId);

The domain layer should never directly instantiate repository implementations, but instead receive them through dependency injection.