mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-24 23:15:35 -04:00
clean up a bunch of exceptions
This commit is contained in:
parent
c077a0290f
commit
bf38c2c44d
21 changed files with 244 additions and 166 deletions
|
@ -6,6 +6,7 @@ import 'package:sorted_list/sorted_list.dart';
|
|||
import 'package:veilid_support/veilid_support.dart';
|
||||
|
||||
import '../../../proto/proto.dart' as proto;
|
||||
import '../../../tools/tools.dart';
|
||||
import 'author_input_queue.dart';
|
||||
import 'author_input_source.dart';
|
||||
import 'output_position.dart';
|
||||
|
@ -62,17 +63,24 @@ class MessageReconciliation {
|
|||
Future<AuthorInputQueue?> _enqueueAuthorInput(
|
||||
{required TypedKey author,
|
||||
required AuthorInputSource inputSource}) async {
|
||||
// Get the position of our most recent reconciled message from this author
|
||||
final outputPosition = await _findLastOutputPosition(author: author);
|
||||
try {
|
||||
// Get the position of our most recent reconciled message from this author
|
||||
final outputPosition = await _findLastOutputPosition(author: author);
|
||||
|
||||
// Find oldest message we have not yet reconciled
|
||||
final inputQueue = await AuthorInputQueue.create(
|
||||
author: author,
|
||||
inputSource: inputSource,
|
||||
outputPosition: outputPosition,
|
||||
onError: _onError,
|
||||
);
|
||||
return inputQueue;
|
||||
// Find oldest message we have not yet reconciled
|
||||
final inputQueue = await AuthorInputQueue.create(
|
||||
author: author,
|
||||
inputSource: inputSource,
|
||||
outputPosition: outputPosition,
|
||||
onError: _onError,
|
||||
);
|
||||
return inputQueue;
|
||||
// Catch everything so we can avoid ParallelWaitError
|
||||
// ignore: avoid_catches_without_on_clauses
|
||||
} catch (e, st) {
|
||||
log.error('Exception enqueing author input: $e:\n$st\n');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Get the position of our most recent reconciled message from this author
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue