Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New groups implementation #1584

Open
wants to merge 91 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 69 commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
d41496a
Strings work
Sep 6, 2024
b2c9cc1
Merge remote-tracking branch 'origin/dev' into closed_groups
SessionHero01 Sep 11, 2024
952479a
Merge remote-tracking branch 'origin/dev' into closed_groups
SessionHero01 Sep 11, 2024
cc64f46
Fix up compilation issues
SessionHero01 Sep 12, 2024
841bc69
Remove conversation settings and added back group operation
SessionHero01 Sep 12, 2024
dc1075e
Edit menu for groups
SessionHero01 Sep 12, 2024
32f9533
Delete conversation on home screen
SessionHero01 Sep 12, 2024
80e3e56
Extract login into GroupManagerV2
SessionHero01 Sep 18, 2024
8c1eb15
Improvement
SessionHero01 Sep 24, 2024
5c380bd
Fixed compilation errors
SessionHero01 Sep 24, 2024
57c95ea
Set name
SessionHero01 Sep 24, 2024
b13b7e6
Handle message deletion
SessionHero01 Sep 25, 2024
7eb615f
Group poller improvement
SessionHero01 Sep 25, 2024
771d63e
Config revamp WIP
SessionHero01 Sep 26, 2024
b9f5f94
Put back invite contacts job
SessionHero01 Sep 26, 2024
e9e6706
Job queue improvement
SessionHero01 Oct 1, 2024
45a66d0
Config revamp
SessionHero01 Oct 1, 2024
3faae5d
Getting rid of .get call on promise
SessionHero01 Oct 2, 2024
1f5fde0
Various issues
SessionHero01 Oct 2, 2024
a5c89d8
Clock management and kicked
SessionHero01 Oct 3, 2024
49b9ec9
Expiring message handling for groups
SessionHero01 Oct 3, 2024
677cd6a
Merge remote-tracking branch 'origin/dev' into closed_groups
SessionHero01 Oct 3, 2024
6ab4ff2
Compilation errors after merge
SessionHero01 Oct 3, 2024
08ee07f
Send message improvement
SessionHero01 Oct 3, 2024
8dd2f36
Group keys and message response improvement
SessionHero01 Oct 4, 2024
02df41e
Updated libsession-util
SessionHero01 Oct 4, 2024
80344f0
Incorrect timestamp
SessionHero01 Oct 4, 2024
d2a4f12
Config uploader
SessionHero01 Oct 7, 2024
79db7bd
Tidy up storage
SessionHero01 Oct 7, 2024
8c9dfdf
Move config sync task into dedicated class
SessionHero01 Oct 7, 2024
4998ceb
Tidy up dependency injection
SessionHero01 Oct 7, 2024
7f008b5
Delete group thread upon config changes
SessionHero01 Oct 7, 2024
2523975
More DI fixes
ThomasSession Oct 2, 2024
71009c3
Fix up more DI
SessionHero01 Oct 7, 2024
962df47
Fixed crashes leaving un-polled groups
SessionHero01 Oct 7, 2024
e937e2b
Merge remote-tracking branch 'origin/dev' into closed_groups
SessionHero01 Oct 7, 2024
4bf2c87
Incorrect imports
SessionHero01 Oct 7, 2024
999ce6e
Fixed unit tests
SessionHero01 Oct 7, 2024
966b8e0
Close group poller issue
SessionHero01 Oct 8, 2024
db8784f
Config lock contention and loading timeout issue
SessionHero01 Oct 8, 2024
a8839af
Config update details and config syncing issue
SessionHero01 Oct 8, 2024
7175a31
Merge remote-tracking branch 'origin/dev' into closed_groups
SessionHero01 Oct 10, 2024
1f9b00b
Merge remote-tracking branch 'origin/dev' into closed_groups
SessionHero01 Oct 14, 2024
222df30
Fix compilation issues
SessionHero01 Oct 14, 2024
007fda6
Merge remote-tracking branch 'origin/dev' into closed_groups
SessionHero01 Oct 14, 2024
6814f0a
Merge remote-tracking branch 'origin/dev' into closed_groups
SessionHero01 Oct 15, 2024
1b9b5dd
Compilation errors
SessionHero01 Oct 15, 2024
e0ea98a
Use config's contact directly
SessionHero01 Oct 15, 2024
b8e98ec
Update copy
SessionHero01 Oct 15, 2024
4536aca
Improvement
SessionHero01 Oct 20, 2024
0657ab2
Polling improvement for group
SessionHero01 Oct 21, 2024
88df9ff
Tidy up
SessionHero01 Oct 21, 2024
afb7cc1
Leaving message sending optimisation
SessionHero01 Oct 21, 2024
f794458
Kick handling
SessionHero01 Oct 21, 2024
01ef596
Remove unused files
SessionHero01 Oct 22, 2024
0bc933d
Merge remote-tracking branch 'origin/dev' into closed_groups
SessionHero01 Oct 22, 2024
c6aefc5
Fixed merge conflicts
SessionHero01 Oct 23, 2024
7c1efea
Merge remote-tracking branch 'origin/dev' into closed_groups
SessionHero01 Oct 23, 2024
5e44d3f
Fixed compilation issue
SessionHero01 Oct 23, 2024
cfd04f9
Fixed Group control message not showing
SessionHero01 Oct 23, 2024
74f7bbb
Added bottom options dialog
SessionHero01 Oct 23, 2024
6e1fa1b
UI adjustment
SessionHero01 Oct 24, 2024
2fa4335
Fixed height for group name editing
SessionHero01 Oct 24, 2024
d21cb39
Removed a few member options under debug flag
SessionHero01 Oct 24, 2024
6abe6c6
clearAll + same name checking before updating
SessionHero01 Oct 24, 2024
122838d
Updated icons
SessionHero01 Oct 24, 2024
e89cbdf
Renamed group terminology
SessionHero01 Oct 24, 2024
0518134
More group renaming
SessionHero01 Oct 24, 2024
5b26912
Fixed huawei push notification
SessionHero01 Oct 24, 2024
86a9e07
Alert text color
SessionHero01 Oct 25, 2024
ea714a6
Group message deletion
SessionHero01 Oct 25, 2024
5cc57fc
Fixed up legacy group banner
SessionHero01 Oct 28, 2024
b77a35a
Merge remote-tracking branch 'origin/dev' into closed_groups
SessionHero01 Oct 28, 2024
b06aee7
Fixed up legacy group banner
SessionHero01 Oct 28, 2024
22b4479
Handle message deletion
SessionHero01 Oct 30, 2024
be087fd
Renamed getCloseGroup -> getGroup
SessionHero01 Oct 30, 2024
abd689c
Check if a groupv2 conversation is admin
SessionHero01 Oct 30, 2024
2b0e8a9
Fixed message request UI still visible after tapping on accept
SessionHero01 Oct 30, 2024
83189ce
Clear messages if user is kicked
SessionHero01 Oct 30, 2024
2e1f9a3
Moved session id input box to qa tag
SessionHero01 Oct 30, 2024
1161bac
Updated group naming
SessionHero01 Oct 30, 2024
62783be
Conversation icon size
SessionHero01 Oct 30, 2024
517f8ca
Disappear message for legacy groups too
SessionHero01 Oct 30, 2024
e68f69a
Feedback
SessionHero01 Oct 30, 2024
3870ea4
Search in groupsv2
SessionHero01 Oct 30, 2024
905acab
SnodeAPI scope
SessionHero01 Oct 30, 2024
7520571
Feedback
SessionHero01 Oct 30, 2024
02d4741
Feedback
SessionHero01 Oct 31, 2024
acbeaad
Animation for group name edit
SessionHero01 Oct 31, 2024
1b6f7bc
Expiration message feedback
SessionHero01 Nov 1, 2024
dfc6942
Leave icon update
SessionHero01 Nov 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 10 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
kind: pipeline
type: docker
name: default

steps:
- name: test
image: mingc/android-build-box:1.24.0
commands:
- bash ./gradlew test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
project.properties
.project
.settings
.kotlin
bin/
gen/
.idea/
Expand Down
42 changes: 26 additions & 16 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'org.jetbrains.kotlin.plugin.serialization'
id 'org.jetbrains.kotlin.plugin.compose'
id 'com.google.devtools.ksp'
id 'com.google.dagger.hilt.android'
id 'kotlin-parcelize'
id 'kotlinx-serialization'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'witness'
apply plugin: 'kotlin-parcelize'
apply plugin: 'kotlinx-serialization'

configurations.forEach {
it.exclude module: "commons-logging"
configurations.configureEach {
exclude module: "commons-logging"
}

def canonicalVersionCode = 384
Expand Down Expand Up @@ -40,12 +42,12 @@ android {
useLibrary 'org.apache.http.legacy'

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '17'
}

packagingOptions {
Expand All @@ -54,6 +56,7 @@ android {
}
}


splits {
abi {
enable !project.hasProperty('huawei') // huawei builds do not need the split variants
Expand All @@ -64,7 +67,8 @@ android {
}

buildFeatures {
compose true
viewBinding true
buildConfig true
}

composeOptions {
Expand Down Expand Up @@ -198,11 +202,11 @@ android {
}
}

buildFeatures {
viewBinding true
}

def huaweiEnabled = project.properties['huawei'] != null
lint {
abortOnError true
baseline file('lint-baseline.xml')
}

applicationVariants.configureEach { variant ->
if (variant.flavorName == 'huawei') {
Expand Down Expand Up @@ -261,6 +265,7 @@ dependencies {
ksp("androidx.hilt:hilt-compiler:$jetpackHiltVersion")
ksp("com.google.dagger:hilt-compiler:$daggerHiltVersion")
ksp("com.github.bumptech.glide:ksp:$glideVersion")
implementation("androidx.hilt:hilt-navigation-compose:$androidxHiltVersion")

implementation("com.google.dagger:hilt-android:$daggerHiltVersion")
implementation "androidx.appcompat:appcompat:$appcompatVersion"
Expand Down Expand Up @@ -340,7 +345,6 @@ dependencies {
implementation "com.squareup.okhttp3:okhttp:$okhttpVersion"
implementation "com.squareup.phrase:phrase:$phraseVersion"
implementation 'app.cash.copper:copper-flow:1.0.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion"
implementation "nl.komponents.kovenant:kovenant:$kovenantVersion"
implementation "nl.komponents.kovenant:kovenant-android:$kovenantVersion"
Expand All @@ -363,7 +367,6 @@ dependencies {
androidTestImplementation('com.adevinta.android:barista:4.2.0') {
exclude group: 'org.jetbrains.kotlin'
}

// AndroidJUnitRunner and JUnit Rules
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test:rules:1.5.0'
Expand All @@ -382,6 +385,8 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-web:3.5.1'
androidTestImplementation 'androidx.test.espresso.idling:idling-concurrent:3.5.1'
androidTestImplementation 'androidx.test.espresso:espresso-idling-resource:3.5.1'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:1.5.3"
debugImplementation "androidx.compose.ui:ui-test-manifest:1.5.3"
androidTestUtil 'androidx.test:orchestrator:1.4.2'

testImplementation 'org.robolectric:robolectric:4.12.2'
Expand All @@ -405,6 +410,11 @@ dependencies {
androidTestImplementation "androidx.compose.ui:ui-test-junit4-android"
debugImplementation "androidx.compose.ui:ui-test-manifest"

// Navigation
implementation "androidx.navigation:navigation-fragment-ktx:$navVersion"
implementation "androidx.navigation:navigation-ui-ktx:$navVersion"
implementation "androidx.navigation:navigation-compose:$navVersion"

implementation "com.google.accompanist:accompanist-themeadapter-appcompat:0.33.1-alpha"
implementation "com.google.accompanist:accompanist-permissions:0.36.0"
implementation "com.google.accompanist:accompanist-drawablepainter:0.33.1-alpha"
Expand Down
3 changes: 3 additions & 0 deletions app/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
<application>
<uses-library android:name="android.test.runner"
android:required="false" />

<activity android:name="androidx.activity.ComponentActivity"/>

</application>
</manifest>
143 changes: 143 additions & 0 deletions app/src/androidTest/java/network/loki/messenger/CreateGroupTests.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
package network.loki.messenger

import androidx.compose.ui.test.hasContentDescriptionExactly
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.performClick
import androidx.compose.ui.test.performTextInput
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import androidx.test.platform.app.InstrumentationRegistry
import org.hamcrest.CoreMatchers.*
import org.hamcrest.MatcherAssert.*
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.thoughtcrime.securesms.ApplicationContext
import org.thoughtcrime.securesms.groups.compose.CreateGroup
import org.thoughtcrime.securesms.groups.ViewState
import org.thoughtcrime.securesms.ui.theme.PreviewTheme

@RunWith(AndroidJUnit4::class)
@SmallTest
class CreateGroupTests {

@get:Rule
val composeTest = createComposeRule()

@Test
fun testNavigateToCreateGroup() {
val application = InstrumentationRegistry.getInstrumentation().targetContext.applicationContext as ApplicationContext
// Accessibility IDs
val nameDesc = application.getString(R.string.AccessibilityId_closed_group_edit_group_name)
val buttonDesc = application.getString(R.string.AccessibilityId_create_closed_group_create_button)

var backPressed = false
var closePressed = false

composeTest.setContent {
PreviewTheme {
CreateGroup(
viewState = ViewState.DEFAULT,
onBack = { backPressed = true },
onClose = { closePressed = true },
onContactItemClicked = {},
updateState = {}
)
}
}

with(composeTest) {
onNode(hasContentDescriptionExactly(nameDesc)).performTextInput("Name")
onNode(hasContentDescriptionExactly(buttonDesc)).performClick()
}

assertThat(backPressed, equalTo(false))
assertThat(closePressed, equalTo(false))

}

@Test
fun testFailToCreate() {
val application = InstrumentationRegistry.getInstrumentation().targetContext.applicationContext as ApplicationContext
// Accessibility IDs
val nameDesc = application.getString(R.string.AccessibilityId_closed_group_edit_group_name)
val buttonDesc = application.getString(R.string.AccessibilityId_create_closed_group_create_button)

var backPressed = false
var closePressed = false

composeTest.setContent {
PreviewTheme {
CreateGroup(
viewState = ViewState.DEFAULT,
onBack = { backPressed = true },
onClose = { closePressed = true },
updateState = {},
onContactItemClicked = {}
)
}
}
with(composeTest) {
onNode(hasContentDescriptionExactly(nameDesc)).performTextInput("")
onNode(hasContentDescriptionExactly(buttonDesc)).performClick()
}

assertThat(backPressed, equalTo(false))
assertThat(closePressed, equalTo(false))
}

@Test
fun testBackButton() {
val application = InstrumentationRegistry.getInstrumentation().targetContext.applicationContext as ApplicationContext
// Accessibility IDs
val backDesc = application.getString(R.string.new_conversation_dialog_back_button_content_description)

var backPressed = false

composeTest.setContent {
PreviewTheme {
CreateGroup(
viewState = ViewState.DEFAULT,
onBack = { backPressed = true },
onClose = {},
onContactItemClicked = {},
updateState = {}
)
}
}

with (composeTest) {
onNode(hasContentDescriptionExactly(backDesc)).performClick()
}

assertThat(backPressed, equalTo(true))
}

@Test
fun testCloseButton() {
val application = InstrumentationRegistry.getInstrumentation().targetContext.applicationContext as ApplicationContext
// Accessibility IDs
val closeDesc = application.getString(R.string.new_conversation_dialog_close_button_content_description)
var closePressed = false

composeTest.setContent {
PreviewTheme {
CreateGroup(
viewState = ViewState.DEFAULT,
onBack = { },
onClose = { closePressed = true },
onContactItemClicked = {},
updateState = {}
)
}
}

with (composeTest) {
onNode(hasContentDescriptionExactly(closeDesc)).performClick()
}

assertThat(closePressed, equalTo(true))
}


}
Loading