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
@@ -65,7 +65,6 @@ class AutomationJobsCubit extends Cubit<AutomationJobsState> {
Future<void> deleteJob(String id) async {
try {
await _api.delete(id);
_logger.info(message: 'Automation job deleted', extra: {'job_id': id});
await loadJobs();
} catch (e, stackTrace) {
_logger.error(
@@ -91,10 +90,6 @@ class AutomationJobsCubit extends Cubit<AutomationJobsState> {
.map((job) => job.id == id ? updated : job)
.toList();
emit(state.copyWith(jobs: nextJobs));
_logger.info(
message: 'Automation job status updated',
extra: {'job_id': id, 'enabled': enabled},
);
} catch (e, stackTrace) {
_logger.error(
message: 'Failed to update automation job status',