diff --git a/analysis_options.yaml b/analysis_options.yaml index bf536544..4aaf5356 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -26,6 +26,13 @@ analyzer: - "**.arb" - "test/drift/**" - "**.g.dart" + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** linter: rules: diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 010108ce..04f4a14f 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -177,7 +177,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: audio_waveforms: a6dde7fe7c0ea05f06ffbdb0f7c1b2b2ba6cedcf cryptography_flutter_plus: 44f4e9e4079395fcbb3e7809c0ac2c6ae2d9576f - Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 + Flutter: 71a624a5bc0c04062bf19101d501e466baf2fb47 flutter_image_compress_common: 1697a328fd72bfb335507c6bca1a65fa5ad87df1 flutter_sharing_intent: 0c1e53949f09fa8df8ac2268505687bde8ff264c flutter_volume_controller: c2be490cb0487e8b88d0d9fc2b7e1c139a4ebccb diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 02744fea..60389e6f 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -742,7 +742,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -886,7 +886,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -939,7 +939,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/lib/src/database/daos/groups.dao.dart b/lib/src/database/daos/groups.dao.dart index f70abe50..3d294a52 100644 --- a/lib/src/database/daos/groups.dao.dart +++ b/lib/src/database/daos/groups.dao.dart @@ -275,7 +275,7 @@ class GroupsDao extends DatabaseAccessor with _$GroupsDaoMixin { ), ], )..where(groups.isDirectChat.equals(false))); - return query.map((row) => row.readTable(groupMembers)).get(); + return await query.map((row) => row.readTable(groupMembers)).get(); } catch (e) { Log.error(e); return []; @@ -346,8 +346,9 @@ class GroupsDao extends DatabaseAccessor with _$GroupsDaoMixin { DateTime newLastMessage, ) async { final now = clock.now(); - final clampedLastMessage = - newLastMessage.isAfter(now) ? now : newLastMessage; + final clampedLastMessage = newLastMessage.isAfter(now) + ? now + : newLastMessage; await (update(groupMembers)..where( (t) => t.groupId.equals(groupId) & diff --git a/lib/src/services/api/server_messages.api.dart b/lib/src/services/api/server_messages.api.dart index cd778309..85e7c088 100644 --- a/lib/src/services/api/server_messages.api.dart +++ b/lib/src/services/api/server_messages.api.dart @@ -154,13 +154,13 @@ Future _handleClient2ClientMessage( contactWillSendsReceipt: const Value(false), ), ); - await tryToSendCompleteMessage( - receiptId: receiptId, - blocking: false, - ); } catch (e) { Log.warn('[$receiptId] Error handling duplicate receipt ACK: $e'); } + await tryToSendCompleteMessage( + receiptId: receiptId, + blocking: false, + ); return; } @@ -289,12 +289,13 @@ Future _handleClient2ClientMessage( } catch (e) { Log.warn('[$receiptId] Error inserting receipt: $e'); } - if (targetReceiptId != null) { - await tryToSendCompleteMessage( - receiptId: targetReceiptId, - blocking: false, - ); - } + + targetReceiptId ??= receiptIdDB?.value ?? receiptId; + + await tryToSendCompleteMessage( + receiptId: targetReceiptId, + blocking: false, + ); } case Message_Type.TEST_NOTIFICATION: break; diff --git a/lib/src/services/group.service.dart b/lib/src/services/group.service.dart index 6e933fe3..1613b525 100644 --- a/lib/src/services/group.service.dart +++ b/lib/src/services/group.service.dart @@ -347,7 +347,7 @@ Future<(int, EncryptedGroupState)?> fetchGroupState(Group group) async { } // the state is now updated and the appended_group_state should be removed on the server, so just call this // function again, to sync the local database - return fetchGroupState(group); + return await fetchGroupState(group); } catch (e) { Log.error(e); return null; diff --git a/lib/src/services/passwordless_recovery.service.dart b/lib/src/services/passwordless_recovery.service.dart index 0ac3d199..46fafde8 100644 --- a/lib/src/services/passwordless_recovery.service.dart +++ b/lib/src/services/passwordless_recovery.service.dart @@ -202,11 +202,11 @@ class PasswordlessRecoveryService { case SecondFactorType.pin: // The pin seed - never shared with the server - ensures that the server is unable to brute-force real user's pin - config.serverKeyProtection = getRandomUint8List(32); - - // As the pin is heavily protected against brute-forcing e.g. will be deleted by the server after 10 tries, the - // unlock token is required to prevent a malicious user (except the trusted friends) to trigger this deletion. - config.pinUnlockToken = getRandomUint8List(32); + config + ..serverKeyProtection = getRandomUint8List(32) + // As the pin is heavily protected against brute-forcing e.g. will be deleted by the server after 10 tries, the + // unlock token is required to prevent a malicious user (except the trusted friends) to trigger this deletion. + ..pinUnlockToken = getRandomUint8List(32); // Brute-force protection for the user's pin: // - Server: Does not know the seed. diff --git a/lib/src/visual/views/camera/camera_preview_components/save_to_gallery.dart b/lib/src/visual/views/camera/camera_preview_components/save_to_gallery.dart index c57a780d..e4b4916d 100644 --- a/lib/src/visual/views/camera/camera_preview_components/save_to_gallery.dart +++ b/lib/src/visual/views/camera/camera_preview_components/save_to_gallery.dart @@ -91,10 +91,10 @@ class SaveToGalleryButtonState extends State { valueColor: AlwaysStoppedAnimation(Colors.white), ), ) + else if (_imageSaved) + const Icon(Icons.check, size: 14) else - _imageSaved - ? const Icon(Icons.check, size: 14) - : const FaIcon(FontAwesomeIcons.floppyDisk, size: 14), + const FaIcon(FontAwesomeIcons.floppyDisk, size: 14), if (widget.displayButtonLabel) const SizedBox(width: 10), if (widget.displayButtonLabel) Text( diff --git a/lib/src/visual/views/camera/share_image_editor.view.dart b/lib/src/visual/views/camera/share_image_editor.view.dart index dc9ee59b..91d85187 100644 --- a/lib/src/visual/views/camera/share_image_editor.view.dart +++ b/lib/src/visual/views/camera/share_image_editor.view.dart @@ -125,7 +125,7 @@ class _ShareImageEditorView extends State { await videoController!.play(); setState(() {}); }) - // ignore: argument_type_not_assignable_to_error_handler, invalid_return_type_for_catch_error + // ignore: argument_type_not_assignable_to_error_handler .catchError(Log.error); } } diff --git a/lib/src/visual/views/chats/chat_messages_components/chat_list_entry.dart b/lib/src/visual/views/chats/chat_messages_components/chat_list_entry.dart index 7be02cfd..12a2f8bd 100644 --- a/lib/src/visual/views/chats/chat_messages_components/chat_list_entry.dart +++ b/lib/src/visual/views/chats/chat_messages_components/chat_list_entry.dart @@ -272,17 +272,18 @@ class _ChatListEntryState extends State { : MainAxisAlignment.start, children: [ if (!right && !widget.group.isDirectChat) - hideContactAvatar - ? const SizedBox(width: 24) - : GestureDetector( - onTap: () => context.push( - Routes.profileContact(widget.message.senderId!), - ), - child: AvatarIcon( - contactId: widget.message.senderId, - fontSize: 12, - ), - ), + if (hideContactAvatar) + const SizedBox(width: 24) + else + GestureDetector( + onTap: () => context.push( + Routes.profileContact(widget.message.senderId!), + ), + child: AvatarIcon( + contactId: widget.message.senderId, + fontSize: 12, + ), + ), child, ], ), diff --git a/lib/src/visual/views/onboarding/register.view.dart b/lib/src/visual/views/onboarding/register.view.dart index 9d4f638b..7903b9f0 100644 --- a/lib/src/visual/views/onboarding/register.view.dart +++ b/lib/src/visual/views/onboarding/register.view.dart @@ -115,7 +115,7 @@ class _RegisterViewState extends State { if (res.error == ErrorCode.UserIdAlreadyTaken) { Log.error('User ID already token. Tying again.'); await deleteLocalUserData(); - return createNewUser(); + return await createNewUser(); } if (res.error == ErrorCode.UsernameAlreadyTaken || res.error == ErrorCode.UsernameNotValid) { diff --git a/pubspec.lock b/pubspec.lock index 08733f02..42528d22 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1107,10 +1107,10 @@ packages: dependency: "direct main" description: name: intl - sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" + sha256: "1ca20c894b1717686a2319b8548763d812bc0aabdac580420a44c5178c57a867" url: "https://pub.dev" source: hosted - version: "0.20.2" + version: "0.20.3" introduction_screen: dependency: "direct main" description: @@ -1256,10 +1256,10 @@ packages: dependency: transitive description: name: matcher - sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861 + sha256: "31bd099b47c10cd1aeb55146a2d46ce0277630ecef3f7dae54ad7873f36696cd" url: "https://pub.dev" source: hosted - version: "0.12.19" + version: "0.12.20" material_color_utilities: dependency: transitive description: @@ -1280,10 +1280,10 @@ packages: dependency: "direct main" description: name: meta - sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349" + sha256: "307249ce4ff29d58a18e97f6345f539382eb9c9c29ecda628900f31de0443dd9" url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.19.0" mime: dependency: transitive description: @@ -1858,10 +1858,10 @@ packages: dependency: transitive description: name: test_api - sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e" + sha256: "2a122cbe059f8b610d3a5415f42e255b6c17b1f21eee1d960f31080237fb4f11" url: "https://pub.dev" source: hosted - version: "0.7.11" + version: "0.7.12" timezone: dependency: transitive description: @@ -1978,10 +1978,10 @@ packages: dependency: transitive description: name: vector_math - sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b + sha256: f36f9f3be64c6198714492bb455c11056e33e2f85d9a0b676a48301e44fdcf47 url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.4.2" very_good_analysis: dependency: "direct dev" description: diff --git a/pubspec.yaml b/pubspec.yaml index 9441b449..1d672695 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: "twonly, a privacy-friendly way to connect with friends through sec publish_to: 'none' -version: 0.5.1+170 +version: 0.5.1+171 environment: sdk: ^3.11.0 diff --git a/test/mocks/user_environment.dart b/test/mocks/user_environment.dart index be4e21c0..f2056b30 100644 --- a/test/mocks/user_environment.dart +++ b/test/mocks/user_environment.dart @@ -99,7 +99,6 @@ class UserEnvironment { appVersion: 100, ); - // ignore: cascade_invocations us.isUserCreated = true; final identityKeyPair = generateIdentityKeyPair();