From dce7d3f78b5b77e61d67604d538df02d99f4a3c2 Mon Sep 17 00:00:00 2001 From: cameronvoell Date: Tue, 11 Jun 2024 07:16:13 -0700 Subject: [PATCH 1/3] Added test for catching pending commit error after invalid permissions commit --- example/src/tests/groupPermissionsTests.ts | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/example/src/tests/groupPermissionsTests.ts b/example/src/tests/groupPermissionsTests.ts index 9b2cc78b9..8359f0f33 100644 --- a/example/src/tests/groupPermissionsTests.ts +++ b/example/src/tests/groupPermissionsTests.ts @@ -316,3 +316,35 @@ test('can not remove a super admin from a group', async () => { return true }) + +test('can commit after invalid permissions commit', async () => { + // Create clients + const [alix, bo, caro] = await createClients(3) + + // Bo creates a group with Alix and Caro + const boGroup = await bo.conversations.newGroup([alix.address, caro.address], 'all_members') + await alix.conversations.syncGroups() + const alixGroup = (await alix.conversations.listGroups())[0] + + // Verify that Alix cannot add an admin + assert((await boGroup.groupName()) === "New Group", `boGroup.groupName should be "New Group" but was ${boGroup.groupName}`) + try { + await alixGroup.addAdmin(alix.inboxId) + } catch (error) { + // expected + } + + await alixGroup.sync() + await boGroup.sync() + + // Verify that Alix can update the group name + await boGroup.sync() + await alixGroup.sync() + await alixGroup.updateGroupName("Alix group name") + await alixGroup.sync() + await boGroup.sync() + assert((await boGroup.groupName()) === "Alix group name", `boGroup.groupName should be "Alix group name" but was ${boGroup.groupName}`) + assert((await alixGroup.groupName()) === "Alix group name", `alixGroup.groupName should be "Alix group name" but was ${alixGroup.groupName}`) + + return true +}) From 04d1023d02516a7553cce0a4e58b6549a34fd184 Mon Sep 17 00:00:00 2001 From: cameronvoell Date: Tue, 11 Jun 2024 07:39:59 -0700 Subject: [PATCH 2/3] fix: clear pending commits after invalid permission update --- android/build.gradle | 2 +- ios/XMTPReactNative.podspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index d1e92d799..0581e0935 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -98,7 +98,7 @@ repositories { dependencies { implementation project(':expo-modules-core') implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}" - implementation "org.xmtp:android:0.12.3" + implementation "org.xmtp:android:0.12.4" implementation 'com.google.code.gson:gson:2.10.1' implementation 'com.facebook.react:react-native:0.71.3' implementation "com.daveanthonythomas.moshipack:moshipack:1.0.1" diff --git a/ios/XMTPReactNative.podspec b/ios/XMTPReactNative.podspec index 40611a765..a84d0f4a8 100644 --- a/ios/XMTPReactNative.podspec +++ b/ios/XMTPReactNative.podspec @@ -26,5 +26,5 @@ Pod::Spec.new do |s| s.source_files = "**/*.{h,m,swift}" s.dependency 'secp256k1.swift' s.dependency "MessagePacker" - s.dependency "XMTP", "= 0.11.4" + s.dependency "XMTP", "= 0.11.5" end From 4db135e7683ed24224072edfda03af4b29ca657f Mon Sep 17 00:00:00 2001 From: cameronvoell Date: Tue, 11 Jun 2024 07:52:32 -0700 Subject: [PATCH 3/3] lint fix, updated tests --- example/ios/Podfile.lock | 772 --------------------- example/src/tests/groupPermissionsTests.ts | 60 +- example/src/tests/groupTests.ts | 4 +- 3 files changed, 38 insertions(+), 798 deletions(-) delete mode 100644 example/ios/Podfile.lock diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock deleted file mode 100644 index 3fbbdd707..000000000 --- a/example/ios/Podfile.lock +++ /dev/null @@ -1,772 +0,0 @@ -PODS: - - BigInt (5.0.0) - - boost (1.76.0) - - CoinbaseWalletSDK/Client (1.0.4) - - CoinbaseWalletSDK/CrossPlatform (1.0.4): - - CoinbaseWalletSDK/Client - - CoinbaseWalletSDKExpo (1.0.10): - - CoinbaseWalletSDK/CrossPlatform (= 1.0.4) - - ExpoModulesCore - - Connect-Swift (0.12.0): - - SwiftProtobuf (~> 1.25.2) - - DoubleConversion (1.1.6) - - EXApplication (5.4.0): - - ExpoModulesCore - - EXConstants (14.2.1): - - ExpoModulesCore - - EXFileSystem (15.2.2): - - ExpoModulesCore - - EXFont (11.1.1): - - ExpoModulesCore - - EXImageLoader (4.4.0): - - ExpoModulesCore - - React-Core - - Expo (48.0.21): - - ExpoModulesCore - - ExpoClipboard (4.5.0): - - ExpoModulesCore - - ExpoDocumentPicker (11.7.0): - - ExpoModulesCore - - ExpoImagePicker (14.5.0): - - ExpoModulesCore - - ExpoKeepAwake (12.0.1): - - ExpoModulesCore - - ExpoModulesCore (1.2.7): - - React-Core - - React-RCTAppDelegate - - ReactCommon/turbomodule/core - - ExpoSecureStore (12.5.0): - - ExpoModulesCore - - EXSplashScreen (0.18.2): - - ExpoModulesCore - - React-Core - - FBLazyVector (0.71.14) - - FBReactNativeSpec (0.71.14): - - RCT-Folly (= 2021.07.22.00) - - RCTRequired (= 0.71.14) - - RCTTypeSafety (= 0.71.14) - - React-Core (= 0.71.14) - - React-jsi (= 0.71.14) - - ReactCommon/turbomodule/core (= 0.71.14) - - fmt (6.2.1) - - GenericJSON (2.0.2) - - glog (0.3.5) - - GzipSwift (5.1.1) - - hermes-engine (0.71.14): - - hermes-engine/Pre-built (= 0.71.14) - - hermes-engine/Pre-built (0.71.14) - - libevent (2.1.12) - - LibXMTP (0.5.1-beta0) - - Logging (1.0.0) - - MessagePacker (0.4.7) - - MMKV (1.3.5): - - MMKVCore (~> 1.3.5) - - MMKVCore (1.3.5) - - OpenSSL-Universal (1.1.2200) - - RCT-Folly (2021.07.22.00): - - boost - - DoubleConversion - - fmt (~> 6.2.1) - - glog - - RCT-Folly/Default (= 2021.07.22.00) - - RCT-Folly/Default (2021.07.22.00): - - boost - - DoubleConversion - - fmt (~> 6.2.1) - - glog - - RCT-Folly/Futures (2021.07.22.00): - - boost - - DoubleConversion - - fmt (~> 6.2.1) - - glog - - libevent - - RCTRequired (0.71.14) - - RCTTypeSafety (0.71.14): - - FBLazyVector (= 0.71.14) - - RCTRequired (= 0.71.14) - - React-Core (= 0.71.14) - - React (0.71.14): - - React-Core (= 0.71.14) - - React-Core/DevSupport (= 0.71.14) - - React-Core/RCTWebSocket (= 0.71.14) - - React-RCTActionSheet (= 0.71.14) - - React-RCTAnimation (= 0.71.14) - - React-RCTBlob (= 0.71.14) - - React-RCTImage (= 0.71.14) - - React-RCTLinking (= 0.71.14) - - React-RCTNetwork (= 0.71.14) - - React-RCTSettings (= 0.71.14) - - React-RCTText (= 0.71.14) - - React-RCTVibration (= 0.71.14) - - React-callinvoker (0.71.14) - - React-Codegen (0.71.14): - - FBReactNativeSpec - - hermes-engine - - RCT-Folly - - RCTRequired - - RCTTypeSafety - - React-Core - - React-jsi - - React-jsiexecutor - - ReactCommon/turbomodule/bridging - - ReactCommon/turbomodule/core - - React-Core (0.71.14): - - glog - - hermes-engine - - RCT-Folly (= 2021.07.22.00) - - React-Core/Default (= 0.71.14) - - React-cxxreact (= 0.71.14) - - React-hermes - - React-jsi (= 0.71.14) - - React-jsiexecutor (= 0.71.14) - - React-perflogger (= 0.71.14) - - Yoga - - React-Core/CoreModulesHeaders (0.71.14): - - glog - - hermes-engine - - RCT-Folly (= 2021.07.22.00) - - React-Core/Default - - React-cxxreact (= 0.71.14) - - React-hermes - - React-jsi (= 0.71.14) - - React-jsiexecutor (= 0.71.14) - - React-perflogger (= 0.71.14) - - Yoga - - React-Core/Default (0.71.14): - - glog - - hermes-engine - - RCT-Folly (= 2021.07.22.00) - - React-cxxreact (= 0.71.14) - - React-hermes - - React-jsi (= 0.71.14) - - React-jsiexecutor (= 0.71.14) - - React-perflogger (= 0.71.14) - - Yoga - - React-Core/DevSupport (0.71.14): - - glog - - hermes-engine - - RCT-Folly (= 2021.07.22.00) - - React-Core/Default (= 0.71.14) - - React-Core/RCTWebSocket (= 0.71.14) - - React-cxxreact (= 0.71.14) - - React-hermes - - React-jsi (= 0.71.14) - - React-jsiexecutor (= 0.71.14) - - React-jsinspector (= 0.71.14) - - React-perflogger (= 0.71.14) - - Yoga - - React-Core/RCTActionSheetHeaders (0.71.14): - - glog - - hermes-engine - - RCT-Folly (= 2021.07.22.00) - - React-Core/Default - - React-cxxreact (= 0.71.14) - - React-hermes - - React-jsi (= 0.71.14) - - React-jsiexecutor (= 0.71.14) - - React-perflogger (= 0.71.14) - - Yoga - - React-Core/RCTAnimationHeaders (0.71.14): - - glog - - hermes-engine - - RCT-Folly (= 2021.07.22.00) - - React-Core/Default - - React-cxxreact (= 0.71.14) - - React-hermes - - React-jsi (= 0.71.14) - - React-jsiexecutor (= 0.71.14) - - React-perflogger (= 0.71.14) - - Yoga - - React-Core/RCTBlobHeaders (0.71.14): - - glog - - hermes-engine - - RCT-Folly (= 2021.07.22.00) - - React-Core/Default - - React-cxxreact (= 0.71.14) - - React-hermes - - React-jsi (= 0.71.14) - - React-jsiexecutor (= 0.71.14) - - React-perflogger (= 0.71.14) - - Yoga - - React-Core/RCTImageHeaders (0.71.14): - - glog - - hermes-engine - - RCT-Folly (= 2021.07.22.00) - - React-Core/Default - - React-cxxreact (= 0.71.14) - - React-hermes - - React-jsi (= 0.71.14) - - React-jsiexecutor (= 0.71.14) - - React-perflogger (= 0.71.14) - - Yoga - - React-Core/RCTLinkingHeaders (0.71.14): - - glog - - hermes-engine - - RCT-Folly (= 2021.07.22.00) - - React-Core/Default - - React-cxxreact (= 0.71.14) - - React-hermes - - React-jsi (= 0.71.14) - - React-jsiexecutor (= 0.71.14) - - React-perflogger (= 0.71.14) - - Yoga - - React-Core/RCTNetworkHeaders (0.71.14): - - glog - - hermes-engine - - RCT-Folly (= 2021.07.22.00) - - React-Core/Default - - React-cxxreact (= 0.71.14) - - React-hermes - - React-jsi (= 0.71.14) - - React-jsiexecutor (= 0.71.14) - - React-perflogger (= 0.71.14) - - Yoga - - React-Core/RCTSettingsHeaders (0.71.14): - - glog - - hermes-engine - - RCT-Folly (= 2021.07.22.00) - - React-Core/Default - - React-cxxreact (= 0.71.14) - - React-hermes - - React-jsi (= 0.71.14) - - React-jsiexecutor (= 0.71.14) - - React-perflogger (= 0.71.14) - - Yoga - - React-Core/RCTTextHeaders (0.71.14): - - glog - - hermes-engine - - RCT-Folly (= 2021.07.22.00) - - React-Core/Default - - React-cxxreact (= 0.71.14) - - React-hermes - - React-jsi (= 0.71.14) - - React-jsiexecutor (= 0.71.14) - - React-perflogger (= 0.71.14) - - Yoga - - React-Core/RCTVibrationHeaders (0.71.14): - - glog - - hermes-engine - - RCT-Folly (= 2021.07.22.00) - - React-Core/Default - - React-cxxreact (= 0.71.14) - - React-hermes - - React-jsi (= 0.71.14) - - React-jsiexecutor (= 0.71.14) - - React-perflogger (= 0.71.14) - - Yoga - - React-Core/RCTWebSocket (0.71.14): - - glog - - hermes-engine - - RCT-Folly (= 2021.07.22.00) - - React-Core/Default (= 0.71.14) - - React-cxxreact (= 0.71.14) - - React-hermes - - React-jsi (= 0.71.14) - - React-jsiexecutor (= 0.71.14) - - React-perflogger (= 0.71.14) - - Yoga - - React-CoreModules (0.71.14): - - RCT-Folly (= 2021.07.22.00) - - RCTTypeSafety (= 0.71.14) - - React-Codegen (= 0.71.14) - - React-Core/CoreModulesHeaders (= 0.71.14) - - React-jsi (= 0.71.14) - - React-RCTBlob - - React-RCTImage (= 0.71.14) - - ReactCommon/turbomodule/core (= 0.71.14) - - React-cxxreact (0.71.14): - - boost (= 1.76.0) - - DoubleConversion - - glog - - hermes-engine - - RCT-Folly (= 2021.07.22.00) - - React-callinvoker (= 0.71.14) - - React-jsi (= 0.71.14) - - React-jsinspector (= 0.71.14) - - React-logger (= 0.71.14) - - React-perflogger (= 0.71.14) - - React-runtimeexecutor (= 0.71.14) - - React-hermes (0.71.14): - - DoubleConversion - - glog - - hermes-engine - - RCT-Folly (= 2021.07.22.00) - - RCT-Folly/Futures (= 2021.07.22.00) - - React-cxxreact (= 0.71.14) - - React-jsi - - React-jsiexecutor (= 0.71.14) - - React-jsinspector (= 0.71.14) - - React-perflogger (= 0.71.14) - - React-jsi (0.71.14): - - boost (= 1.76.0) - - DoubleConversion - - glog - - hermes-engine - - RCT-Folly (= 2021.07.22.00) - - React-jsiexecutor (0.71.14): - - DoubleConversion - - glog - - hermes-engine - - RCT-Folly (= 2021.07.22.00) - - React-cxxreact (= 0.71.14) - - React-jsi (= 0.71.14) - - React-perflogger (= 0.71.14) - - React-jsinspector (0.71.14) - - React-logger (0.71.14): - - glog - - react-native-blob-util (0.19.6): - - React-Core - - react-native-config (1.5.1): - - react-native-config/App (= 1.5.1) - - react-native-config/App (1.5.1): - - React-Core - - react-native-encrypted-storage (4.0.3): - - React-Core - - react-native-get-random-values (1.11.0): - - React-Core - - react-native-mmkv (2.11.0): - - MMKV (>= 1.2.13) - - React-Core - - react-native-netinfo (11.2.1): - - React-Core - - react-native-quick-base64 (2.0.8): - - React-Core - - react-native-quick-crypto (0.6.1): - - OpenSSL-Universal - - React - - React-callinvoker - - React-Core - - react-native-randombytes (3.6.1): - - React-Core - - react-native-safe-area-context (4.5.0): - - RCT-Folly - - RCTRequired - - RCTTypeSafety - - React-Core - - ReactCommon/turbomodule/core - - react-native-sqlite-storage (6.0.1): - - React-Core - - react-native-webview (13.8.1): - - RCT-Folly (= 2021.07.22.00) - - React-Core - - React-perflogger (0.71.14) - - React-RCTActionSheet (0.71.14): - - React-Core/RCTActionSheetHeaders (= 0.71.14) - - React-RCTAnimation (0.71.14): - - RCT-Folly (= 2021.07.22.00) - - RCTTypeSafety (= 0.71.14) - - React-Codegen (= 0.71.14) - - React-Core/RCTAnimationHeaders (= 0.71.14) - - React-jsi (= 0.71.14) - - ReactCommon/turbomodule/core (= 0.71.14) - - React-RCTAppDelegate (0.71.14): - - RCT-Folly - - RCTRequired - - RCTTypeSafety - - React-Core - - ReactCommon/turbomodule/core - - React-RCTBlob (0.71.14): - - hermes-engine - - RCT-Folly (= 2021.07.22.00) - - React-Codegen (= 0.71.14) - - React-Core/RCTBlobHeaders (= 0.71.14) - - React-Core/RCTWebSocket (= 0.71.14) - - React-jsi (= 0.71.14) - - React-RCTNetwork (= 0.71.14) - - ReactCommon/turbomodule/core (= 0.71.14) - - React-RCTImage (0.71.14): - - RCT-Folly (= 2021.07.22.00) - - RCTTypeSafety (= 0.71.14) - - React-Codegen (= 0.71.14) - - React-Core/RCTImageHeaders (= 0.71.14) - - React-jsi (= 0.71.14) - - React-RCTNetwork (= 0.71.14) - - ReactCommon/turbomodule/core (= 0.71.14) - - React-RCTLinking (0.71.14): - - React-Codegen (= 0.71.14) - - React-Core/RCTLinkingHeaders (= 0.71.14) - - React-jsi (= 0.71.14) - - ReactCommon/turbomodule/core (= 0.71.14) - - React-RCTNetwork (0.71.14): - - RCT-Folly (= 2021.07.22.00) - - RCTTypeSafety (= 0.71.14) - - React-Codegen (= 0.71.14) - - React-Core/RCTNetworkHeaders (= 0.71.14) - - React-jsi (= 0.71.14) - - ReactCommon/turbomodule/core (= 0.71.14) - - React-RCTSettings (0.71.14): - - RCT-Folly (= 2021.07.22.00) - - RCTTypeSafety (= 0.71.14) - - React-Codegen (= 0.71.14) - - React-Core/RCTSettingsHeaders (= 0.71.14) - - React-jsi (= 0.71.14) - - ReactCommon/turbomodule/core (= 0.71.14) - - React-RCTText (0.71.14): - - React-Core/RCTTextHeaders (= 0.71.14) - - React-RCTVibration (0.71.14): - - RCT-Folly (= 2021.07.22.00) - - React-Codegen (= 0.71.14) - - React-Core/RCTVibrationHeaders (= 0.71.14) - - React-jsi (= 0.71.14) - - ReactCommon/turbomodule/core (= 0.71.14) - - React-runtimeexecutor (0.71.14): - - React-jsi (= 0.71.14) - - ReactCommon/turbomodule/bridging (0.71.14): - - DoubleConversion - - glog - - hermes-engine - - RCT-Folly (= 2021.07.22.00) - - React-callinvoker (= 0.71.14) - - React-Core (= 0.71.14) - - React-cxxreact (= 0.71.14) - - React-jsi (= 0.71.14) - - React-logger (= 0.71.14) - - React-perflogger (= 0.71.14) - - ReactCommon/turbomodule/core (0.71.14): - - DoubleConversion - - glog - - hermes-engine - - RCT-Folly (= 2021.07.22.00) - - React-callinvoker (= 0.71.14) - - React-Core (= 0.71.14) - - React-cxxreact (= 0.71.14) - - React-jsi (= 0.71.14) - - React-logger (= 0.71.14) - - React-perflogger (= 0.71.14) - - RNCAsyncStorage (1.21.0): - - React-Core - - RNFS (2.20.0): - - React-Core - - RNScreens (3.20.0): - - React-Core - - React-RCTImage - - RNSVG (13.14.0): - - React-Core - - secp256k1.swift (0.1.4) - - SwiftProtobuf (1.25.2) - - web3.swift (1.6.0): - - BigInt (~> 5.0.0) - - GenericJSON (~> 2.0) - - Logging (~> 1.0.0) - - secp256k1.swift (~> 0.1) - - XMTP (0.11.4): - - Connect-Swift (= 0.12.0) - - GzipSwift - - LibXMTP (= 0.5.1-beta0) - - web3.swift - - XMTPReactNative (0.1.0): - - ExpoModulesCore - - MessagePacker - - secp256k1.swift - - XMTP (= 0.11.4) - - Yoga (1.14.0) - -DEPENDENCIES: - - boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`) - - "CoinbaseWalletSDKExpo (from `../node_modules/@coinbase/wallet-mobile-sdk/ios`)" - - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) - - EXApplication (from `../node_modules/expo-application/ios`) - - EXConstants (from `../node_modules/expo-constants/ios`) - - EXFileSystem (from `../node_modules/expo-file-system/ios`) - - EXFont (from `../node_modules/expo-font/ios`) - - EXImageLoader (from `../node_modules/expo-image-loader/ios`) - - Expo (from `../node_modules/expo`) - - ExpoClipboard (from `../node_modules/expo-clipboard/ios`) - - ExpoDocumentPicker (from `../node_modules/expo-document-picker/ios`) - - ExpoImagePicker (from `../node_modules/expo-image-picker/ios`) - - ExpoKeepAwake (from `../node_modules/expo-keep-awake/ios`) - - ExpoModulesCore (from `../node_modules/expo-modules-core`) - - ExpoSecureStore (from `../node_modules/expo-secure-store/ios`) - - EXSplashScreen (from `../node_modules/expo-splash-screen/ios`) - - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) - - FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`) - - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) - - hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`) - - libevent (~> 2.1.12) - - OpenSSL-Universal (= 1.1.2200) - - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) - - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) - - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) - - React (from `../node_modules/react-native/`) - - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`) - - React-Codegen (from `build/generated/ios`) - - React-Core (from `../node_modules/react-native/`) - - React-Core/RCTWebSocket (from `../node_modules/react-native/`) - - React-CoreModules (from `../node_modules/react-native/React/CoreModules`) - - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`) - - React-hermes (from `../node_modules/react-native/ReactCommon/hermes`) - - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) - - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) - - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) - - React-logger (from `../node_modules/react-native/ReactCommon/logger`) - - react-native-blob-util (from `../node_modules/react-native-blob-util`) - - react-native-config (from `../node_modules/react-native-config`) - - react-native-encrypted-storage (from `../node_modules/react-native-encrypted-storage`) - - react-native-get-random-values (from `../node_modules/react-native-get-random-values`) - - react-native-mmkv (from `../node_modules/react-native-mmkv`) - - "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)" - - react-native-quick-base64 (from `../node_modules/react-native-quick-base64`) - - react-native-quick-crypto (from `../node_modules/react-native-quick-crypto`) - - react-native-randombytes (from `../node_modules/react-native-randombytes`) - - react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`) - - react-native-sqlite-storage (from `../node_modules/react-native-sqlite-storage`) - - react-native-webview (from `../node_modules/react-native-webview`) - - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`) - - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) - - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`) - - React-RCTAppDelegate (from `../node_modules/react-native/Libraries/AppDelegate`) - - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`) - - React-RCTImage (from `../node_modules/react-native/Libraries/Image`) - - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`) - - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`) - - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`) - - React-RCTText (from `../node_modules/react-native/Libraries/Text`) - - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) - - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`) - - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) - - "RNCAsyncStorage (from `../node_modules/@react-native-async-storage/async-storage`)" - - RNFS (from `../node_modules/react-native-fs`) - - RNScreens (from `../node_modules/react-native-screens`) - - RNSVG (from `../node_modules/react-native-svg`) - - XMTPReactNative (from `../../ios`) - - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) - -SPEC REPOS: - trunk: - - BigInt - - CoinbaseWalletSDK - - Connect-Swift - - fmt - - GenericJSON - - GzipSwift - - libevent - - LibXMTP - - Logging - - MessagePacker - - MMKV - - MMKVCore - - OpenSSL-Universal - - secp256k1.swift - - SwiftProtobuf - - web3.swift - - XMTP - -EXTERNAL SOURCES: - boost: - :podspec: "../node_modules/react-native/third-party-podspecs/boost.podspec" - CoinbaseWalletSDKExpo: - :path: "../node_modules/@coinbase/wallet-mobile-sdk/ios" - DoubleConversion: - :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" - EXApplication: - :path: "../node_modules/expo-application/ios" - EXConstants: - :path: "../node_modules/expo-constants/ios" - EXFileSystem: - :path: "../node_modules/expo-file-system/ios" - EXFont: - :path: "../node_modules/expo-font/ios" - EXImageLoader: - :path: "../node_modules/expo-image-loader/ios" - Expo: - :path: "../node_modules/expo" - ExpoClipboard: - :path: "../node_modules/expo-clipboard/ios" - ExpoDocumentPicker: - :path: "../node_modules/expo-document-picker/ios" - ExpoImagePicker: - :path: "../node_modules/expo-image-picker/ios" - ExpoKeepAwake: - :path: "../node_modules/expo-keep-awake/ios" - ExpoModulesCore: - :path: "../node_modules/expo-modules-core" - ExpoSecureStore: - :path: "../node_modules/expo-secure-store/ios" - EXSplashScreen: - :path: "../node_modules/expo-splash-screen/ios" - FBLazyVector: - :path: "../node_modules/react-native/Libraries/FBLazyVector" - FBReactNativeSpec: - :path: "../node_modules/react-native/React/FBReactNativeSpec" - glog: - :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" - hermes-engine: - :podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec" - RCT-Folly: - :podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec" - RCTRequired: - :path: "../node_modules/react-native/Libraries/RCTRequired" - RCTTypeSafety: - :path: "../node_modules/react-native/Libraries/TypeSafety" - React: - :path: "../node_modules/react-native/" - React-callinvoker: - :path: "../node_modules/react-native/ReactCommon/callinvoker" - React-Codegen: - :path: build/generated/ios - React-Core: - :path: "../node_modules/react-native/" - React-CoreModules: - :path: "../node_modules/react-native/React/CoreModules" - React-cxxreact: - :path: "../node_modules/react-native/ReactCommon/cxxreact" - React-hermes: - :path: "../node_modules/react-native/ReactCommon/hermes" - React-jsi: - :path: "../node_modules/react-native/ReactCommon/jsi" - React-jsiexecutor: - :path: "../node_modules/react-native/ReactCommon/jsiexecutor" - React-jsinspector: - :path: "../node_modules/react-native/ReactCommon/jsinspector" - React-logger: - :path: "../node_modules/react-native/ReactCommon/logger" - react-native-blob-util: - :path: "../node_modules/react-native-blob-util" - react-native-config: - :path: "../node_modules/react-native-config" - react-native-encrypted-storage: - :path: "../node_modules/react-native-encrypted-storage" - react-native-get-random-values: - :path: "../node_modules/react-native-get-random-values" - react-native-mmkv: - :path: "../node_modules/react-native-mmkv" - react-native-netinfo: - :path: "../node_modules/@react-native-community/netinfo" - react-native-quick-base64: - :path: "../node_modules/react-native-quick-base64" - react-native-quick-crypto: - :path: "../node_modules/react-native-quick-crypto" - react-native-randombytes: - :path: "../node_modules/react-native-randombytes" - react-native-safe-area-context: - :path: "../node_modules/react-native-safe-area-context" - react-native-sqlite-storage: - :path: "../node_modules/react-native-sqlite-storage" - react-native-webview: - :path: "../node_modules/react-native-webview" - React-perflogger: - :path: "../node_modules/react-native/ReactCommon/reactperflogger" - React-RCTActionSheet: - :path: "../node_modules/react-native/Libraries/ActionSheetIOS" - React-RCTAnimation: - :path: "../node_modules/react-native/Libraries/NativeAnimation" - React-RCTAppDelegate: - :path: "../node_modules/react-native/Libraries/AppDelegate" - React-RCTBlob: - :path: "../node_modules/react-native/Libraries/Blob" - React-RCTImage: - :path: "../node_modules/react-native/Libraries/Image" - React-RCTLinking: - :path: "../node_modules/react-native/Libraries/LinkingIOS" - React-RCTNetwork: - :path: "../node_modules/react-native/Libraries/Network" - React-RCTSettings: - :path: "../node_modules/react-native/Libraries/Settings" - React-RCTText: - :path: "../node_modules/react-native/Libraries/Text" - React-RCTVibration: - :path: "../node_modules/react-native/Libraries/Vibration" - React-runtimeexecutor: - :path: "../node_modules/react-native/ReactCommon/runtimeexecutor" - ReactCommon: - :path: "../node_modules/react-native/ReactCommon" - RNCAsyncStorage: - :path: "../node_modules/@react-native-async-storage/async-storage" - RNFS: - :path: "../node_modules/react-native-fs" - RNScreens: - :path: "../node_modules/react-native-screens" - RNSVG: - :path: "../node_modules/react-native-svg" - XMTPReactNative: - :path: "../../ios" - Yoga: - :path: "../node_modules/react-native/ReactCommon/yoga" - -SPEC CHECKSUMS: - BigInt: 74b4d88367b0e819d9f77393549226d36faeb0d8 - boost: 57d2868c099736d80fcd648bf211b4431e51a558 - CoinbaseWalletSDK: ea1f37512bbc69ebe07416e3b29bf840f5cc3152 - CoinbaseWalletSDKExpo: c79420eb009f482f768c23b6768fc5b2d7c98777 - Connect-Swift: 1de2ef4a548c59ecaeb9120812dfe0d6e07a0d47 - DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 - EXApplication: 2a0d9abd4feace9c6faedfe541c1dec02e3702cd - EXConstants: f348da07e21b23d2b085e270d7b74f282df1a7d9 - EXFileSystem: 844e86ca9b5375486ecc4ef06d3838d5597d895d - EXFont: 6ea3800df746be7233208d80fe379b8ed74f4272 - EXImageLoader: 03063370bc06ea1825713d3f55fe0455f7c88d04 - Expo: 0d9f112757acc6bf32103eabccf91267780bd580 - ExpoClipboard: d2f0e44d50e5ba07b02f5fb7bd280178b420e24e - ExpoDocumentPicker: d3b6b0ed2dbbc2f05158e0294dd3f4673f386e5f - ExpoImagePicker: 9e5c745cb3e56ee00e1cfe5d6af59caab66ecf1a - ExpoKeepAwake: 69f5f627670d62318410392d03e0b5db0f85759a - ExpoModulesCore: 653958063a301098b541ae4dfed1ac0b98db607b - ExpoSecureStore: 5372610a4bbcf5e50fafbe6f38f8d9c22edf8253 - EXSplashScreen: 0e0a9ba0cf7553094e93213099bd7b42e6e237e9 - FBLazyVector: 12ea01e587c9594e7b144e1bfc86ac4d9ac28fde - FBReactNativeSpec: b6ae48e67aaba46442f84d6f9ba598ccfbe2ee66 - fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 - GenericJSON: 79a840eeb77030962e8cf02a62d36bd413b67626 - glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b - GzipSwift: 893f3e48e597a1a4f62fafcb6514220fcf8287fa - hermes-engine: d7cc127932c89c53374452d6f93473f1970d8e88 - libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 - LibXMTP: ae1c59652261b6ab48e1cf78ee890e96eb7b7024 - Logging: 9ef4ecb546ad3169398d5a723bc9bea1c46bef26 - MessagePacker: ab2fe250e86ea7aedd1a9ee47a37083edd41fd02 - MMKV: 506311d0494023c2f7e0b62cc1f31b7370fa3cfb - MMKVCore: 9e2e5fd529b64a9fe15f1a7afb3d73b2e27b4db9 - OpenSSL-Universal: 6e1ae0555546e604dbc632a2b9a24a9c46c41ef6 - RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1 - RCTRequired: e9df143e880d0e879e7a498dc06923d728809c79 - RCTTypeSafety: c2d89c8308829c12c038ec1f431191eaa0d8c15c - React: 52b89a818f4b2579c98567f3aa8bde880d9e843b - React-callinvoker: 56e399c88c05e037fe99c31978f30e75fad5c286 - React-Codegen: 7ece62f4d4896ad1933f834a7dad697676636318 - React-Core: f06b7b00e0d49433a316760ae61a0f8f5dee6629 - React-CoreModules: bd520e5688b5aa4666965a1b3b8e6d4a2e19df20 - React-cxxreact: ba6a1663685837fa4c2ac97daa95dd2e47f1acdc - React-hermes: c862e573ca0228070936b5ec4f475c3e19e900e0 - React-jsi: 533030c161bcfcbc3a4ad0b357ced8f7b2be457e - React-jsiexecutor: 94cfc1788637ceaf8841ef1f69b10cc0d62baadc - React-jsinspector: 7bf923954b4e035f494b01ac16633963412660d7 - React-logger: 655ff5db8bd922acfbe76a4983ffab048916343e - react-native-blob-util: d8fa1a7f726867907a8e43163fdd8b441d4489ea - react-native-config: 86038147314e2e6d10ea9972022aa171e6b1d4d8 - react-native-encrypted-storage: db300a3f2f0aba1e818417c1c0a6be549038deb7 - react-native-get-random-values: 21325b2244dfa6b58878f51f9aa42821e7ba3d06 - react-native-mmkv: e97c0c79403fb94577e5d902ab1ebd42b0715b43 - react-native-netinfo: 8a7fd3f7130ef4ad2fb4276d5c9f8d3f28d2df3d - react-native-quick-base64: 777057ea4286f806b00259ede65dc79c7c706320 - react-native-quick-crypto: 455c1b411db006dba1026a30681ececb19180187 - react-native-randombytes: 421f1c7d48c0af8dbcd471b0324393ebf8fe7846 - react-native-safe-area-context: 39c2d8be3328df5d437ac1700f4f3a4f75716acc - react-native-sqlite-storage: f6d515e1c446d1e6d026aa5352908a25d4de3261 - react-native-webview: bdc091de8cf7f8397653e30182efcd9f772e03b3 - React-perflogger: 4987ad83731c23d11813c84263963b0d3028c966 - React-RCTActionSheet: 5ad952b2a9740d87a5bd77280c4bc23f6f89ea0c - React-RCTAnimation: d2de22af3f536cc80bb5b3918e1a455114d1b985 - React-RCTAppDelegate: 27f7d735cad3d522c13008ea80020d350017c422 - React-RCTBlob: b697e0e2e38ec85bd726176851a3b476a490ad33 - React-RCTImage: a07e8c7d4768f62ebc6277e4680f6b979c619967 - React-RCTLinking: d00ae55db37b2c12ebab91135f06f75391c0708d - React-RCTNetwork: b3a401276e5c08487d8a14fdec1720e78b5888db - React-RCTSettings: d606cbac31403604c5d5746e6dab53bb332f9301 - React-RCTText: b3bd40bc71bca0c3e2cc5ce2c40870a438f303b1 - React-RCTVibration: 64e412b9ac684c4edc938fa1187135ada9af7faf - React-runtimeexecutor: ffe826b7b1cfbc32a35ed5b64d5886c0ff75f501 - ReactCommon: 7f3dd5e98a9ec627c6b03d26c062bf37ea9fc888 - RNCAsyncStorage: 618d03a5f52fbccb3d7010076bc54712844c18ef - RNFS: 4ac0f0ea233904cb798630b3c077808c06931688 - RNScreens: 218801c16a2782546d30bd2026bb625c0302d70f - RNSVG: d00c8f91c3cbf6d476451313a18f04d220d4f396 - secp256k1.swift: a7e7a214f6db6ce5db32cc6b2b45e5c4dd633634 - SwiftProtobuf: 407a385e97fd206c4fbe880cc84123989167e0d1 - web3.swift: 2263d1e12e121b2c42ffb63a5a7beb1acaf33959 - XMTP: 93c576a55976baeec67f3cc3911c1db8dbd3f86d - XMTPReactNative: 930c288252e5a4b9946d053385ff9e26b4036d8d - Yoga: e71803b4c1fff832ccf9b92541e00f9b873119b9 - -PODFILE CHECKSUM: 95d6ace79946933ecf80684613842ee553dd76a2 - -COCOAPODS: 1.15.2 diff --git a/example/src/tests/groupPermissionsTests.ts b/example/src/tests/groupPermissionsTests.ts index 8359f0f33..129cf206b 100644 --- a/example/src/tests/groupPermissionsTests.ts +++ b/example/src/tests/groupPermissionsTests.ts @@ -94,11 +94,11 @@ test('in admin only group, members can not update group name unless they are an ) } - // Verify group name is New Group + // Verify group name is empty string const groupName = await alixGroup.groupName() assert( - groupName === 'New Group', - `group name should be New Group but was ${groupName}` + groupName === '', + `group name should be empty string but was ${groupName}` ) // Verify that bo can not update the group name @@ -129,11 +129,11 @@ test('in admin only group, members can update group name once they are an admin' ) } - // Verify group name is New Group + // Verify group name is empty string let groupName = await alixGroup.groupName() assert( - groupName === 'New Group', - `group name should be New Group but was ${groupName}` + groupName === '', + `group name should be empty string but was ${groupName}` ) // Verify that bo can not update the group name @@ -180,11 +180,11 @@ test('in admin only group, members can not update group name after admin status ) } - // Verify group name is New Group + // Verify group name is empty string let groupName = await alixGroup.groupName() assert( - groupName === 'New Group', - `group name should be New Group but was ${groupName}` + groupName === '', + `group name should be empty string but was ${groupName}` ) // Alix adds bo as an admin @@ -280,14 +280,13 @@ test('can not remove a super admin from a group', async () => { boIsSuperAdmin = await boGroup.isSuperAdmin(bo.inboxId) assert(boIsSuperAdmin, `bo should be a super admin`) - // Uncommenting below causes an error - // intent 3 has reached max publish attempts - // error publishing intents CreateGroupContextExtProposalError(MlsGroupStateError(PendingCommit)) - // try { - // await boGroup.removeMembersByInboxId([alix.inboxId]) - // } catch (error) { - // // expected - // } + // Verify bo can not remove alix bc alix is a super admin + try { + await boGroup.removeMembersByInboxId([alix.inboxId]) + // eslint-disable-next-line @typescript-eslint/no-unused-vars + } catch (error) { + // expected + } await boGroup.sync() await alixGroup.sync() numMembers = (await alixGroup.memberInboxIds()).length @@ -322,14 +321,21 @@ test('can commit after invalid permissions commit', async () => { const [alix, bo, caro] = await createClients(3) // Bo creates a group with Alix and Caro - const boGroup = await bo.conversations.newGroup([alix.address, caro.address], 'all_members') + const boGroup = await bo.conversations.newGroup( + [alix.address, caro.address], + 'all_members' + ) await alix.conversations.syncGroups() const alixGroup = (await alix.conversations.listGroups())[0] // Verify that Alix cannot add an admin - assert((await boGroup.groupName()) === "New Group", `boGroup.groupName should be "New Group" but was ${boGroup.groupName}`) - try { - await alixGroup.addAdmin(alix.inboxId) + assert( + (await boGroup.groupName()) === '', + `boGroup.groupName should be empty string but was ${boGroup.groupName}` + ) + try { + await alixGroup.addAdmin(alix.inboxId) + // eslint-disable-next-line @typescript-eslint/no-unused-vars } catch (error) { // expected } @@ -340,11 +346,17 @@ test('can commit after invalid permissions commit', async () => { // Verify that Alix can update the group name await boGroup.sync() await alixGroup.sync() - await alixGroup.updateGroupName("Alix group name") + await alixGroup.updateGroupName('Alix group name') await alixGroup.sync() await boGroup.sync() - assert((await boGroup.groupName()) === "Alix group name", `boGroup.groupName should be "Alix group name" but was ${boGroup.groupName}`) - assert((await alixGroup.groupName()) === "Alix group name", `alixGroup.groupName should be "Alix group name" but was ${alixGroup.groupName}`) + assert( + (await boGroup.groupName()) === 'Alix group name', + `boGroup.groupName should be "Alix group name" but was ${boGroup.groupName}` + ) + assert( + (await alixGroup.groupName()) === 'Alix group name', + `alixGroup.groupName should be "Alix group name" but was ${alixGroup.groupName}` + ) return true }) diff --git a/example/src/tests/groupTests.ts b/example/src/tests/groupTests.ts index 2e0c22e1e..b326e38e9 100644 --- a/example/src/tests/groupTests.ts +++ b/example/src/tests/groupTests.ts @@ -1524,7 +1524,7 @@ test('can read and update group name', async () => { await alixGroup.sync() let groupName = await alixGroup.groupName() - assert(groupName === 'New Group', 'group name should be "New Group"') + assert(groupName === '', 'group name should be empty string') await alixGroup.updateGroupName('Test name update 1') @@ -1540,7 +1540,7 @@ test('can read and update group name', async () => { const boGroup = (await bo.conversations.listGroups())[0] groupName = await boGroup.groupName() - assert(groupName === 'New Group', 'group name should be "New Group"') + assert(groupName === '', 'group name should be empty string') await boGroup.sync()