fix(infrared): propagate repository storage errors and recover learning keys across effective profiles

This commit is contained in:
2026-08-25 12:51:47 +08:00
parent b6cae9b2c9
commit a3812aae27
5 changed files with 104 additions and 28 deletions
@@ -134,10 +134,12 @@ class FakeInfraredKeyRepository : InfraredKeyRepository {
class FakeInfraredDeviceConfigurationRepository : InfraredDeviceConfigurationRepository {
private val lock = Any()
private val deviceNames = MutableStateFlow<Map<ProviderProfileId, DeviceName>>(emptyMap())
var observeError: DomainError? = null
override fun observeDeviceName(
profileId: ProviderProfileId,
): Flow<DomainResult<DeviceName?>> = deviceNames.map { values ->
observeError?.let { return@map DomainResult.Failure(it) }
DomainResult.Success(values[profileId])
}