debugging

This commit is contained in:
Christien Rioux 2023-09-28 12:51:44 -04:00
parent 9e48bc2223
commit 7567a0e3bc
7 changed files with 31 additions and 13 deletions

View File

@ -254,7 +254,8 @@ class InviteDialogState extends ConsumerState<InviteDialog> {
_validInvitation = null;
widget.onValidationFailed();
});
} on Exception catch (_) {
} on Exception catch (e) {
log.debug('exception: $e', e);
setState(() {
_isValidating = false;
_validInvitation = null;

View File

@ -195,7 +195,11 @@ class MainPagerState extends ConsumerState<MainPager>
// ignore: prefer_expression_function_bodies
Widget _onNewChatBottomSheetBuilder(BuildContext context) {
return const SizedBox(height: 200, child: Center(child: Text("test")));
return const SizedBox(
height: 200,
child: Center(
child: Text(
"Group and custom chat functionality is not available yet")));
}
Widget _bottomSheetBuilder(BuildContext context) {

View File

@ -7,6 +7,7 @@ import '../proto/proto.dart' as proto;
import '../proto/proto.dart' show Contact;
import '../veilid_support/veilid_support.dart';
import '../tools/tools.dart';
import 'account.dart';
import 'chat.dart';
@ -54,6 +55,8 @@ Future<void> deleteContact(
final pool = await DHTRecordPool.instance();
final accountRecordKey =
activeAccountInfo.userLogin.accountRecordInfo.accountRecord.recordKey;
final localConversationKey =
proto.TypedKeyProto.fromProto(contact.localConversationRecordKey);
final remoteConversationKey =
proto.TypedKeyProto.fromProto(contact.remoteConversationRecordKey);
@ -80,12 +83,22 @@ Future<void> deleteContact(
break;
}
}
await (await pool.openRead(
proto.TypedKeyProto.fromProto(contact.localConversationRecordKey),
parent: accountRecordKey))
.delete();
await (await pool.openRead(remoteConversationKey, parent: accountRecordKey))
.delete();
try {
await (await pool.openRead(localConversationKey,
parent: accountRecordKey))
.delete();
} on Exception catch (e) {
log.debug('error removing local conversation record key: $e', e);
}
try {
if (localConversationKey != remoteConversationKey) {
await (await pool.openRead(remoteConversationKey,
parent: accountRecordKey))
.delete();
}
} on Exception catch (e) {
log.debug('error removing remove conversation record key: $e', e);
}
});
}

View File

@ -139,7 +139,7 @@ Future<AcceptedOrRejectedContact?> checkAcceptRejectContact(
return acceptReject;
} on Exception catch (e) {
log.error('Exception in checkAcceptRejectContact: $e');
log.error('Exception in checkAcceptRejectContact: $e', e);
// Attempt to clean up. All this needs better lifetime management
await deleteContactInvitation(
@ -471,7 +471,7 @@ Future<AcceptedContact?> acceptContactInvitation(
});
});
} on Exception catch (e) {
log.error('exception: $e');
log.debug('exception: $e', e);
return null;
}
}

View File

@ -40,7 +40,7 @@ class LocalAccounts extends _$LocalAccounts
await eventualVeilid.future;
return await load();
} on Exception catch (e) {
log.error('Failed to load LocalAccounts table: $e');
log.error('Failed to load LocalAccounts table: $e', e);
return const IListConst([]);
}
}

View File

@ -34,7 +34,7 @@ class Logins extends _$Logins with AsyncTableDBBacked<ActiveLogins> {
await eventualVeilid.future;
return await load();
} on Exception catch (e) {
log.error('Failed to load ActiveLogins table: $e');
log.error('Failed to load ActiveLogins table: $e', e);
return const ActiveLogins(userLogins: IListConst([]));
}
}

View File

@ -4,8 +4,8 @@ export 'loggy.dart';
export 'phono_byte.dart';
export 'radix_generator.dart';
export 'responsive.dart';
export 'scanner_error_widget.dart';
export 'secret_crypto.dart';
export 'state_logger.dart';
export 'theme_service.dart';
export 'widget_helpers.dart';
export 'scanner_error_widget.dart';