Fix log and analytics bugs

This commit is contained in:
problematicconsumer
2023-10-03 21:12:14 +03:30
parent ba071643ce
commit 8f15022443
16 changed files with 86 additions and 57 deletions

View File

@@ -73,7 +73,7 @@ class ProfilesRepositoryImpl
() async {
final existingProfile = await profilesDao.getProfileByUrl(url);
if (existingProfile case RemoteProfile()) {
loggy.info("profile with url[$url] already exists, updating");
loggy.info("profile with same url already exists, updating");
final baseProfile = markAsActive
? existingProfile.copyWith(active: true)
: existingProfile;
@@ -120,9 +120,9 @@ class ProfilesRepositoryImpl
final parseResult =
await singbox.parseConfig(path, tempPath, false).run();
return parseResult.fold(
(l) async {
loggy.warning("error parsing config: $l");
return left(ProfileFailure.invalidConfig(l.msg));
(err) async {
loggy.warning("error parsing config", err);
return left(ProfileFailure.invalidConfig(err.msg));
},
(_) async {
final profile = LocalProfile(
@@ -267,9 +267,9 @@ class ProfilesRepositoryImpl
final parseResult =
await singbox.parseConfig(path, tempPath, false).run();
return parseResult.fold(
(l) async {
loggy.warning("error parsing config: $l");
return left(ProfileFailure.invalidConfig(l.msg));
(err) async {
loggy.warning("error parsing config", err);
return left(ProfileFailure.invalidConfig(err.msg));
},
(_) async {
final profile = Profile.fromResponse(url, headers);