fix eventual consistency

This commit is contained in:
Christien Rioux 2024-06-09 14:43:28 -04:00
parent 2c3d4dce93
commit b5612e5dd8
23 changed files with 309 additions and 296 deletions

View file

@ -54,9 +54,7 @@ class ContactListCubit extends DHTShortArrayCubit<proto.Contact> {
// Add Contact to account's list
// if this fails, don't keep retrying, user can try again later
await operateWrite((writer) async {
if (!await writer.tryAdd(contact.writeToBuffer())) {
throw Exception('Failed to add contact record');
}
await writer.add(contact.writeToBuffer());
});
}