fix: correct test failures and error propagation

- Add CacheScope provider in UserProfileCacheRepository tests
- Remove catch blocks that swallowed errors in _loadHistory/_loadMoreHistory
- Errors now properly propagate to switchUser() caller
This commit is contained in:
qzl
2026-04-01 15:11:49 +08:00
parent 640b4d15a3
commit 19aa33a609
9 changed files with 7 additions and 48 deletions
@@ -34,7 +34,7 @@ class RecordVoiceRecorder implements VoiceRecorder {
throw StateError(L10n.current.homeRecorderPluginUnavailable);
}
if (!hasPermission) {
_logger.warning(message: 'Voice recorder permission denied');
_logger.debug(message: 'Voice recorder permission denied');
throw StateError(L10n.current.homeRecorderPermissionDenied);
}
@@ -51,7 +51,6 @@ class RecordVoiceRecorder implements VoiceRecorder {
),
path: path,
);
_logger.info(message: 'Voice recording started', extra: {'path': path});
} on MissingPluginException catch (e, stackTrace) {
_logger.error(
message: 'Failed to start voice recording',
@@ -67,10 +66,6 @@ class RecordVoiceRecorder implements VoiceRecorder {
String? stoppedPath;
try {
stoppedPath = await _recorder.stop();
_logger.info(
message: 'Voice recording stopped',
extra: {'path': stoppedPath ?? _currentPath},
);
} on MissingPluginException catch (e, stackTrace) {
_logger.error(
message: 'Failed to stop voice recording',