From 9ad2da424209d1d124a3c0ad99f63b482b8e5808 Mon Sep 17 00:00:00 2001 From: Kyle H Date: Sat, 18 Nov 2023 18:16:03 +0000 Subject: [PATCH 1/6] Fix empty contact list problem --- lib/tick.dart | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/lib/tick.dart b/lib/tick.dart index 7e55da5..9f71a11 100644 --- a/lib/tick.dart +++ b/lib/tick.dart @@ -38,6 +38,7 @@ class BackgroundTickerState extends ConsumerState { bool _inTick = false; int _contactInvitationCheckTick = 0; int _newMessageCheckTick = 0; + bool _hasRefreshedContactList = false; @override void initState() { @@ -77,6 +78,13 @@ class BackgroundTickerState extends ConsumerState { _inTick = true; try { final unord = >[]; + // If our contact list hasn't been refreshed yet, we need to + // refresh it. This happens every tick until it's non-empty. + // It will not happen until we are attached to Veilid. + if (_hasRefreshedContactList == false) { + unord.add(_doContactListRefresh()); + } + // Check extant contact invitations once every N seconds _contactInvitationCheckTick += 1; if (_contactInvitationCheckTick >= ticksPerContactInvitationCheck) { @@ -98,6 +106,25 @@ class BackgroundTickerState extends ConsumerState { } } + Future _doContactListRefresh() async { + // Don't refresh the contact list until we're connected to Veilid, because + // that's when we can actually communicate. + if (!connectionState.state.isAttached) { + return; + } + // Get the contact list, or an empty IList. + final contactList = ref.read(fetchContactListProvider).asData?.value ?? + const IListConst([]); + if (contactList.isEmpty) { + ref.invalidate(fetchContactListProvider); + } else { + // This happens on the tick after it refreshes, because invalidation + // and refresh happens only once per tick, and we won't know if it + // worked until it has. + _hasRefreshedContactList = true; + } + } + Future _doContactInvitationCheck() async { if (!connectionState.state.isPublicInternetReady) { return; @@ -148,7 +175,9 @@ class BackgroundTickerState extends ConsumerState { if (!connectionState.state.isPublicInternetReady) { return; } + final activeChat = ref.read(activeChatStateProvider); + if (activeChat == null) { return; } @@ -159,7 +188,6 @@ class BackgroundTickerState extends ConsumerState { final contactList = ref.read(fetchContactListProvider).asData?.value ?? const IListConst([]); - final activeChatContactIdx = contactList.indexWhere( (c) => proto.TypedKeyProto.fromProto(c.remoteConversationRecordKey) == From a60fc4000aabc6e1760edfb88288ef6844a933c3 Mon Sep 17 00:00:00 2001 From: TC Johnson Date: Sun, 19 Nov 2023 10:34:28 -0600 Subject: [PATCH 2/6] First Version Tag v0.1.2+4 --- .gitignore | 2 ++ android/app/build.gradle | 32 +++++++++++++++++++++++--------- ios/Podfile.lock | 4 ++-- pubspec.lock | 2 +- pubspec.yaml | 2 +- 5 files changed, 29 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index df26946..dc159e4 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,5 @@ app.*.map.json # WASM /web/wasm/ + +android/key.properties \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index 73a53e5..11a434c 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -25,6 +25,12 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" +def keystoreProperties = new Properties() +def keystorePropertiesFile = rootProject.file('key.properties') +if (keystorePropertiesFile.exists()) { + keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) +} + android { ndkVersion "25.1.8937393" compileSdkVersion flutter.compileSdkVersion @@ -53,15 +59,23 @@ android { versionName flutterVersionName } - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - shrinkResources false - minifyEnabled false - signingConfig signingConfigs.debug - } - } + signingConfigs { + release { + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null + storePassword keystoreProperties['storePassword'] + } + } + + buildTypes { + release { + shrinkResources false + minifyEnabled false + signingConfig signingConfigs.release + } + } + namespace 'com.veilid.veilidchat' } diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 5ba25f2..125a3a8 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -171,8 +171,8 @@ SPEC CHECKSUMS: sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a system_info_plus: 5393c8da281d899950d751713575fbf91c7709aa url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4 - veilid: f5c2e662f91907b30cf95762619526ac3e4512fd + veilid: 51243c25047dbc1ebbfd87d713560260d802b845 PODFILE CHECKSUM: 7f4cf2154d55730d953b184299e6feee7a274740 -COCOAPODS: 1.12.1 +COCOAPODS: 1.14.2 diff --git a/pubspec.lock b/pubspec.lock index d0d040d..04e023f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1552,7 +1552,7 @@ packages: path: "../veilid/veilid-flutter" relative: true source: path - version: "0.2.4" + version: "0.2.5" visibility_detector: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index d498631..faa4993 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: veilidchat description: VeilidChat publish_to: 'none' -version: 1.0.2+0 +version: 0.1.2+4 environment: sdk: '>=3.0.5 <4.0.0' From 79ab46232f86f7effee55614fb6cb7576e43c592 Mon Sep 17 00:00:00 2001 From: TC Date: Sun, 19 Nov 2023 17:23:17 +0000 Subject: [PATCH 3/6] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 36ac2e6..a151886 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,17 +22,18 @@ build: - git clone https://gitlab.com/veilid/veilid.git ../veilid - curl –proto ‘=https’ –tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - source "$HOME/.cargo/env" - - brew install capnp cmake wabt llvm protobuf openjdk@17 jq + - brew install capnp cmake wabt llvm protobuf openjdk@17 jq cocoapods - cargo install wasm-bindgen-cli wasm-pack cargo-edit - - sudo gem install cocoapods - wget https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_arm64_3.13.5-stable.zip - unzip flutter_macos_arm64_3.13.5-stable.zip && export PATH="$PATH:`pwd`/flutter/bin" - #- yes | flutter doctor --android-licenses + - flutter update + - yes | flutter doctor --android-licenses - flutter config --enable-macos-desktop --enable-ios - flutter config --no-analytics - dart --disable-analytics - flutter doctor -v - flutter build ipa + - flutter build appbundle when: manual #test: From c8a36a6ccfa081c5b36c78cde62cb3efe8dee0a7 Mon Sep 17 00:00:00 2001 From: TC Date: Sun, 19 Nov 2023 18:10:44 +0000 Subject: [PATCH 4/6] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a151886..948e3e9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,20 +20,20 @@ build: - echo "place holder for build" - sudo softwareupdate --install-rosetta --agree-to-license - git clone https://gitlab.com/veilid/veilid.git ../veilid - - curl –proto ‘=https’ –tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - - source "$HOME/.cargo/env" - - brew install capnp cmake wabt llvm protobuf openjdk@17 jq cocoapods - - cargo install wasm-bindgen-cli wasm-pack cargo-edit + #- curl –proto ‘=https’ –tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + #- source "$HOME/.cargo/env" + #- brew install capnp cmake wabt llvm protobuf openjdk@17 jq cocoapods + #- cargo install wasm-bindgen-cli wasm-pack cargo-edit - wget https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_arm64_3.13.5-stable.zip - unzip flutter_macos_arm64_3.13.5-stable.zip && export PATH="$PATH:`pwd`/flutter/bin" - - flutter update + - flutter upgrade - yes | flutter doctor --android-licenses - flutter config --enable-macos-desktop --enable-ios - flutter config --no-analytics - dart --disable-analytics - flutter doctor -v - - flutter build ipa - - flutter build appbundle + #- flutter build ipa + #- flutter build appbundle when: manual #test: From 080e411643d424536f3a595708c9ae3de25ac625 Mon Sep 17 00:00:00 2001 From: Kyle Hamilton Date: Wed, 22 Nov 2023 09:29:22 -0500 Subject: [PATCH 5/6] Fixing non-release build signingConfig --- android/app/build.gradle | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 11a434c..c2eb2d7 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -25,10 +25,13 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" +def buildConfig = 'debug' + def keystoreProperties = new Properties() def keystorePropertiesFile = rootProject.file('key.properties') if (keystorePropertiesFile.exists()) { keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) + buildConfig = 'release' } android { @@ -70,9 +73,13 @@ android { buildTypes { release { - shrinkResources false - minifyEnabled false - signingConfig signingConfigs.release + shrinkResources false + minifyEnabled false + if (buildConfig == 'release') { + signingConfig signingConfigs.release + } else { + signingConfig signingConfigs.debug + } } } From c749025e9046a332f46febf5c92852a71ef3c6e0 Mon Sep 17 00:00:00 2001 From: Caleb Jasik Date: Mon, 27 Nov 2023 15:39:21 +0000 Subject: [PATCH 6/6] Fix link to veilid chat in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5437152..82631b7 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ VeilidChat is a chat application written for the Veilid (https://www.veilid.com) distributed application platform. It has a familiar and simple interface and is designed for private, and secure person-to-person communications. -For more information about VeilidChat: https://veilid.chat +For more information about VeilidChat: https://veilid.com/chat/ For more information about the Veilid network protocol and app development platform: https://veilid.com