fix smaller issues
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run

This commit is contained in:
otsmr 2025-12-30 11:21:43 +01:00
parent 6b353d8a66
commit e97f0a910f
5 changed files with 25 additions and 26 deletions

View file

@ -224,13 +224,9 @@ Future<void> downloadFileFast(
Future<void> requestMediaReupload(String mediaId) async { Future<void> requestMediaReupload(String mediaId) async {
final messages = await twonlyDB.messagesDao.getMessagesByMediaId(mediaId); final messages = await twonlyDB.messagesDao.getMessagesByMediaId(mediaId);
if (messages.length != 1 || messages.first.senderId == null) {
Log.error(
'Media file has none or more than one sender. That is not possible',
);
return;
}
for (final message in messages) {
if (message.openedAt != null) continue;
await sendCipherText( await sendCipherText(
messages.first.senderId!, messages.first.senderId!,
EncryptedContent( EncryptedContent(
@ -240,7 +236,6 @@ Future<void> requestMediaReupload(String mediaId) async {
), ),
), ),
); );
await twonlyDB.mediaFilesDao.updateMedia( await twonlyDB.mediaFilesDao.updateMedia(
mediaId, mediaId,
const MediaFilesCompanion( const MediaFilesCompanion(
@ -248,6 +243,7 @@ Future<void> requestMediaReupload(String mediaId) async {
), ),
); );
} }
}
Future<void> handleEncryptedFile(String mediaId) async { Future<void> handleEncryptedFile(String mediaId) async {
final mediaService = await MediaFileService.fromMediaId(mediaId); final mediaService = await MediaFileService.fromMediaId(mediaId);

View file

@ -50,8 +50,10 @@ Future<(Uint8List, Uint8List?)?> tryToSendCompleteMessage({
} }
receiptId = receipt.receiptId; receiptId = receipt.receiptId;
if (!onlyReturnEncryptedData && receipt.ackByServerAt != null) { if (!onlyReturnEncryptedData &&
Log.error('message already uploaded!'); receipt.ackByServerAt != null &&
receipt.markForRetry == null) {
Log.error('Message already uploaded and mark for retry is not set!');
return null; return null;
} }
@ -141,6 +143,7 @@ Future<(Uint8List, Uint8List?)?> tryToSendCompleteMessage({
ackByServerAt: Value(DateTime.now()), ackByServerAt: Value(DateTime.now()),
retryCount: Value(receipt.retryCount + 1), retryCount: Value(receipt.retryCount + 1),
lastRetry: Value(DateTime.now()), lastRetry: Value(DateTime.now()),
markForRetry: const Value(null),
), ),
); );
} }

View file

@ -105,7 +105,7 @@ Future<SignalContactSignedPreKey?> getSignedPreKeyByContactId(
} }
} else { } else {
unawaited(requestNewSignedPreKeyForContact(contactId)); unawaited(requestNewSignedPreKeyForContact(contactId));
Log.error('Contact $contactId does not have a signed pre key!'); Log.warn('Contact $contactId does not have a signed pre key!');
} }
return signedPreKey; return signedPreKey;
} }

View file

@ -51,7 +51,7 @@ class _ProfileViewState extends State<ProfileView> {
..avatarCounter = user.avatarCounter + 1; ..avatarCounter = user.avatarCounter + 1;
return user; return user;
}); });
setState(() {}); // gUser has updated if (mounted) setState(() {}); // gUser has updated
} }
Future<void> _updateUsername(String username) async { Future<void> _updateUsername(String username) async {

View file

@ -3,7 +3,7 @@ description: "twonly, a privacy-friendly way to connect with friends through sec
publish_to: 'none' publish_to: 'none'
version: 0.0.82+82 version: 0.0.83+83
environment: environment:
sdk: ^3.6.0 sdk: ^3.6.0