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,29 +224,25 @@ Future<void> downloadFileFast(
Future<void> requestMediaReupload(String mediaId) async {
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;
}
await sendCipherText(
messages.first.senderId!,
EncryptedContent(
mediaUpdate: EncryptedContent_MediaUpdate(
type: EncryptedContent_MediaUpdate_Type.DECRYPTION_ERROR,
targetMessageId: messages.first.messageId,
for (final message in messages) {
if (message.openedAt != null) continue;
await sendCipherText(
messages.first.senderId!,
EncryptedContent(
mediaUpdate: EncryptedContent_MediaUpdate(
type: EncryptedContent_MediaUpdate_Type.DECRYPTION_ERROR,
targetMessageId: messages.first.messageId,
),
),
),
);
await twonlyDB.mediaFilesDao.updateMedia(
mediaId,
const MediaFilesCompanion(
downloadState: Value(DownloadState.reuploadRequested),
),
);
);
await twonlyDB.mediaFilesDao.updateMedia(
mediaId,
const MediaFilesCompanion(
downloadState: Value(DownloadState.reuploadRequested),
),
);
}
}
Future<void> handleEncryptedFile(String mediaId) async {

View file

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

View file

@ -105,7 +105,7 @@ Future<SignalContactSignedPreKey?> getSignedPreKeyByContactId(
}
} else {
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;
}

View file

@ -51,7 +51,7 @@ class _ProfileViewState extends State<ProfileView> {
..avatarCounter = user.avatarCounter + 1;
return user;
});
setState(() {}); // gUser has updated
if (mounted) setState(() {}); // gUser has updated
}
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'
version: 0.0.82+82
version: 0.0.83+83
environment:
sdk: ^3.6.0