Skip to content

Commit ca61649

Browse files
committed
Fix duplicate folder account id
Prevent duplicate account id for placeholder folder Fixes: 9056 Bring back GH actions read permission to fix daily builds workflow Add instructions to propose ADRs Refactor: move :legacy:common.feature to app-common.feature Refactor: Removed :legacy:preferences from settings.gradle as this module is no longer used & empty Add link to security hashes in README Bump actions/setup-java from 4.7.0 to 4.7.1 Bumps [actions/setup-java](https://github.com/actions/setup-java) from 4.7.0 to 4.7.1. - [Release notes](https://github.com/actions/setup-java/releases) - [Commits](actions/setup-java@3a4f6e1...c5195ef) --- updated-dependencies: - dependency-name: actions/setup-java dependency-version: 4.7.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Bump github/codeql-action from 3.28.14 to 3.28.15 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.14 to 3.28.15. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@fc7e4a0...45775bd) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.28.15 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Bump softprops/action-gh-release from 2.2.1 to 2.2.2 Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.2.1 to 2.2.2. - [Release notes](https://github.com/softprops/action-gh-release/releases) - [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md) - [Commits](softprops/action-gh-release@c95fe14...da05d55) --- updated-dependencies: - dependency-name: softprops/action-gh-release dependency-version: 2.2.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Middle ground, placeholder and counter Fixes: thunderbird#9056 (+1 squashed commit) Squashed commits: [ade7fcb] Adjust fix for testing Fixes: thunderbird#9056
1 parent 61bce4a commit ca61649

File tree

22 files changed

+88
-45
lines changed

22 files changed

+88
-45
lines changed

.github/workflows/android.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Copy CI gradle.properties
2727
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
2828

29-
- uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
29+
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
3030
with:
3131
distribution: 'temurin'
3232
java-version: '17'

.github/workflows/codeql.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2424

25-
- uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
25+
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
2626
with:
2727
distribution: 'temurin'
2828
java-version: '17'
@@ -32,13 +32,13 @@ jobs:
3232
with:
3333
cache-read-only: true
3434

35-
- uses: github/codeql-action/init@fc7e4a0fa01c3cca5fd6a1fddec5c0740c977aa2 # v3.28.14
35+
- uses: github/codeql-action/init@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
3636
with:
3737
languages: java
3838

3939
- name: Autobuild
40-
uses: github/codeql-action/autobuild@fc7e4a0fa01c3cca5fd6a1fddec5c0740c977aa2 # v3.28.14
40+
uses: github/codeql-action/autobuild@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
4141

4242
- name: Perform CodeQL Analysis
43-
uses: github/codeql-action/analyze@fc7e4a0fa01c3cca5fd6a1fddec5c0740c977aa2 # v3.28.14
43+
uses: github/codeql-action/analyze@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
4444

.github/workflows/daily_builds.yml

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ jobs:
1515
secrets: inherit
1616
permissions:
1717
id-token: write # For GCS publishing (ftp.mo)
18+
contents: read

.github/workflows/fluidscan.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ jobs:
3535

3636
# Upload the results to GitHub's code scanning dashboard.
3737
- name: "Upload to code-scanning"
38-
uses: github/codeql-action/upload-sarif@fc7e4a0fa01c3cca5fd6a1fddec5c0740c977aa2 # v3.28.14
38+
uses: github/codeql-action/upload-sarif@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
3939
with:
4040
sarif_file: fluidscan-results.sarif

.github/workflows/gradle-cache.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
steps:
2424
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2525

26-
- uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
26+
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
2727
with:
2828
distribution: 'temurin'
2929
java-version: '17'

.github/workflows/markdown.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Copy CI gradle.properties
2626
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
2727

28-
- uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
28+
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
2929
with:
3030
distribution: 'temurin'
3131
java-version: '17'

.github/workflows/scorecard.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,6 @@ jobs:
6262

6363
# Upload the results to GitHub's code scanning dashboard.
6464
- name: "Upload to code-scanning"
65-
uses: github/codeql-action/upload-sarif@fc7e4a0fa01c3cca5fd6a1fddec5c0740c977aa2 # v3.28.14
65+
uses: github/codeql-action/upload-sarif@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
6666
with:
6767
sarif_file: results.sarif

.github/workflows/shippable_builds.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ jobs:
225225
shell: bash
226226
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
227227

228-
- uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
228+
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
229229
if: ${{ contains(matrix.releaseTarget, 'github') || needs.dump_config.outputs.releaseType == 'daily' }}
230230
with:
231231
distribution: 'temurin'
@@ -474,7 +474,7 @@ jobs:
474474
shell: bash
475475
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
476476

477-
- uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
477+
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
478478
with:
479479
distribution: 'temurin'
480480
java-version: '17'
@@ -775,7 +775,7 @@ jobs:
775775
- name: Publish to GitHub Releases
776776
id: publish_gh
777777
if: ${{ contains(matrix.releaseTarget, 'github') }}
778-
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1
778+
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2
779779
with:
780780
token: ${{ steps.app-token.outputs.token || github.token }}
781781
target_commitish: ${{ steps.shanotes.outputs.app_sha }}

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ By using Thunderbird for Android Beta, you have early access to current developm
2222

2323
Check out the [Release Notes](https://github.com/thunderbird/thunderbird-android/releases) to find out what changed in each version of Thunderbird for Android.
2424

25+
The SHA-256 fingerprints for our signing certificates are available in [SECURITY.md](./SECURITY.md#verifying-fingerprints).
26+
2527
## Need Help? Found a bug? Have an idea? Want to chat?
2628

2729
If the app is not behaving like it should, or you are not sure if you've encountered a bug:

app-common/build.gradle.kts

+6
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@ android {
99
dependencies {
1010
api(projects.legacy.common)
1111

12+
api(projects.legacy.ui.legacy)
13+
1214
api(projects.feature.account.core)
1315

16+
api(projects.feature.launcher)
17+
18+
api(projects.feature.navigation.drawer.api)
19+
1420
implementation(projects.legacy.core)
1521
implementation(projects.legacy.account)
1622

legacy/common/src/main/java/com/fsck/k9/feature/AccountSetupFinishedLauncher.kt renamed to app-common/src/main/kotlin/net/thunderbird/app/common/feature/AccountSetupFinishedLauncher.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.fsck.k9.feature
1+
package net.thunderbird.app.common.feature
22

33
import android.content.Context
44
import app.k9mail.feature.launcher.FeatureLauncherExternalContract

legacy/common/src/main/java/com/fsck/k9/feature/FeatureModule.kt renamed to app-common/src/main/kotlin/net/thunderbird/app/common/feature/FeatureModule.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.fsck.k9.feature
1+
package net.thunderbird.app.common.feature
22

33
import app.k9mail.feature.launcher.FeatureLauncherExternalContract
44
import net.thunderbird.feature.navigation.drawer.api.NavigationDrawerExternalContract
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package net.thunderbird.app.common.feature
2+
3+
import com.fsck.k9.preferences.DrawerConfigManager
4+
import kotlinx.coroutines.flow.Flow
5+
import net.thunderbird.feature.navigation.drawer.api.NavigationDrawerExternalContract
6+
7+
class NavigationDrawerConfigLoader(private val drawerConfigManager: DrawerConfigManager) :
8+
NavigationDrawerExternalContract.DrawerConfigLoader {
9+
override fun loadDrawerConfigFlow(): Flow<NavigationDrawerExternalContract.DrawerConfig> {
10+
return drawerConfigManager.getConfigFlow()
11+
}
12+
}

legacy/common/src/main/java/com/fsck/k9/feature/NavigationDrawerConfigWriter.kt renamed to app-common/src/main/kotlin/net/thunderbird/app/common/feature/NavigationDrawerConfigWriter.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.fsck.k9.feature
1+
package net.thunderbird.app.common.feature
22

33
import com.fsck.k9.preferences.DrawerConfigManager
44
import net.thunderbird.feature.navigation.drawer.api.NavigationDrawerExternalContract

app-k9mail/src/main/kotlin/app/k9mail/feature/FeatureModule.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import app.k9mail.feature.funding.featureFundingModule
55
import app.k9mail.feature.migration.launcher.featureMigrationModule
66
import app.k9mail.feature.onboarding.migration.onboardingMigrationModule
77
import app.k9mail.feature.telemetry.telemetryModule
8-
import com.fsck.k9.feature.featureLauncherModule
8+
import net.thunderbird.app.common.feature.featureLauncherModule
99
import net.thunderbird.feature.account.settings.featureAccountSettingsModule
1010
import org.koin.dsl.module
1111

app-thunderbird/src/main/kotlin/net/thunderbird/android/feature/FeatureModule.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import app.k9mail.feature.funding.featureFundingModule
55
import app.k9mail.feature.migration.launcher.featureMigrationModule
66
import app.k9mail.feature.onboarding.migration.onboardingMigrationModule
77
import app.k9mail.feature.telemetry.telemetryModule
8-
import com.fsck.k9.feature.featureLauncherModule
8+
import net.thunderbird.app.common.feature.featureLauncherModule
99
import net.thunderbird.feature.account.settings.featureAccountSettingsModule
1010
import org.koin.dsl.module
1111

docs/architecture/adr/README.md

+29
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ where each ADR document should contain:
3030
When creating a new ADR, please follow the provided [ADR template file](0000-adr-template.md) and ensure that your
3131
document is clear and concise.
3232

33+
Once you are ready to propose your ADR, you should:
34+
35+
1. Create an issue in the repository, get consensus from at least one other project contributor.
36+
2. Make a post on [the mobile-planning list](https://thunderbird.topicbox.com/groups/mobile-planning)
37+
to announce your ADR. You can use the below template as needed.
38+
3. Create a pull request in the repository linking the issue.
39+
4. Make a decision together with mobile module owners, the PR will be merged when accepted.
40+
3341
## Directory Structure
3442

3543
The ADRs will be stored in a directory named `docs/adr`, and each ADR will be a file named `NNNN-title-with-dashes.md`
@@ -52,3 +60,24 @@ the status or to add more information.
5260

5361
We welcome contributions in the form of new ADRs or updates to existing ones. Please ensure all contributions follow
5462
the standard format and provide clear and concise information.
63+
64+
## Appendix: Intent to Adopt Template
65+
66+
You may use this template in your Intent to Adopt email as noted above. Tweak it as you feel is useful.
67+
68+
> Hello everyone,
69+
>
70+
> I’m writing to share an intent to adopt a new architecture decision: [ADR-[Number]] [Title of ADR]
71+
>
72+
> This change addresses [brief summary of the problem] and proposes [brief description of the approach].
73+
>
74+
> This decision is based on [briefly mention motivating factors, constraints, or technical context].
75+
>
76+
> You can read the full proposal here: [link to ADR]
77+
>
78+
> If you have feedback or concerns, please respond in the linked issue. We plan to finalize the
79+
> decision after [proposed date], factoring in discussion at that time.
80+
>
81+
> Thanks,
82+
> [Your Name]
83+

feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/domain/usecase/GetDisplayTreeFolder.kt

+5-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import net.thunderbird.feature.navigation.drawer.dropdown.domain.entity.DisplayT
1111
import net.thunderbird.feature.navigation.drawer.dropdown.domain.entity.DisplayUnifiedFolder
1212

1313
internal class GetDisplayTreeFolder : UseCase.GetDisplayTreeFolder {
14+
private var placeholderCounter = 0L
1415

1516
override fun invoke(folders: List<DisplayFolder>, maxDepth: Int): DisplayTreeFolder {
1617
val unifiedFolderTreeList = folders.filterIsInstance<DisplayUnifiedFolder>().map {
@@ -49,7 +50,7 @@ internal class GetDisplayTreeFolder : UseCase.GetDisplayTreeFolder {
4950
}
5051
}
5152

52-
fun buildAccountFolderTree(
53+
private fun buildAccountFolderTree(
5354
paths: List<Pair<List<String>, DisplayAccountFolder>>,
5455
parentPath: String = "",
5556
): List<DisplayTreeFolder> {
@@ -87,10 +88,11 @@ internal class GetDisplayTreeFolder : UseCase.GetDisplayTreeFolder {
8788
}
8889

8990
private fun createPlaceholderFolder(name: String): DisplayAccountFolder {
91+
placeholderCounter += 1
9092
return DisplayAccountFolder(
91-
accountId = "accountId",
93+
accountId = "placeholder",
9294
folder = Folder(
93-
id = 0L,
95+
id = placeholderCounter,
9496
name = name,
9597
type = FolderType.REGULAR,
9698
isLocalOnly = false,

feature/navigation/drawer/dropdown/src/test/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/domain/usecase/GetDisplayTreeFolderTest.kt

+15-11
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,9 @@ class GetDisplayTreeFolderTest {
199199
children = persistentListOf(
200200
DisplayTreeFolder(
201201
displayFolder = DisplayAccountFolder(
202-
accountId = "accountId",
202+
accountId = "placeholder",
203203
folder = Folder(
204-
id = 0,
204+
id = 1L,
205205
name = "(Unnamed)/(Unnamed)",
206206
type = FolderType.REGULAR,
207207
isLocalOnly = false,
@@ -238,8 +238,8 @@ class GetDisplayTreeFolderTest {
238238
),
239239
DisplayTreeFolder(
240240
displayFolder = DisplayAccountFolder(
241-
accountId = "accountId",
242-
folder = Folder(id = 0, name = "valid1", type = FolderType.REGULAR, isLocalOnly = false),
241+
accountId = "placeholder",
242+
folder = Folder(id = 2, name = "valid1", type = FolderType.REGULAR, isLocalOnly = false),
243243
isInTopGroup = true,
244244
unreadMessageCount = 0,
245245
starredMessageCount = 0,
@@ -250,9 +250,9 @@ class GetDisplayTreeFolderTest {
250250
children = persistentListOf(
251251
DisplayTreeFolder(
252252
displayFolder = DisplayAccountFolder(
253-
accountId = "accountId",
253+
accountId = "placeholder",
254254
folder = Folder(
255-
id = 0,
255+
id = 3L,
256256
name = "valid1/(Unnamed)",
257257
type = FolderType.REGULAR,
258258
isLocalOnly = false,
@@ -321,7 +321,8 @@ class GetDisplayTreeFolderTest {
321321
children = persistentListOf(
322322
createDisplayTreeFolder(
323323
displayFolder = createDisplayAccountFolder(
324-
folderId = 0L,
324+
accountId = "placeholder",
325+
folderId = 1L,
325326
folderName = "folderLevel1",
326327
unreadMessageCount = 0,
327328
starredMessageCount = 0,
@@ -379,7 +380,8 @@ class GetDisplayTreeFolderTest {
379380
children = persistentListOf(
380381
createDisplayTreeFolder(
381382
displayFolder = createDisplayAccountFolder(
382-
folderId = 0,
383+
accountId = "placeholder",
384+
folderId = 1,
383385
folderName = "level1",
384386
unreadMessageCount = 0,
385387
starredMessageCount = 0,
@@ -390,7 +392,8 @@ class GetDisplayTreeFolderTest {
390392
children = persistentListOf(
391393
createDisplayTreeFolder(
392394
displayFolder = createDisplayAccountFolder(
393-
folderId = 0,
395+
accountId = "placeholder",
396+
folderId = 2L,
394397
folderName = "level1/level2",
395398
unreadMessageCount = 0,
396399
starredMessageCount = 0,
@@ -427,9 +430,10 @@ class GetDisplayTreeFolderTest {
427430
folderName: String,
428431
unreadMessageCount: Int,
429432
starredMessageCount: Int,
430-
): DisplayAccountFolder {
433+
accountId: String = "accountId",
434+
): DisplayAccountFolder {
431435
return DisplayAccountFolder(
432-
accountId = "accountId",
436+
accountId = accountId,
433437
folder = Folder(
434438
id = folderId,
435439
name = folderName,

legacy/common/src/main/java/com/fsck/k9/CommonKoinModule.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.fsck.k9
22

33
import app.k9mail.core.featureflag.FeatureFlagProvider
44
import app.k9mail.core.featureflag.InMemoryFeatureFlagProvider
5+
import app.k9mail.feature.launcher.di.featureLauncherModule
56
import app.k9mail.feature.widget.message.list.messageListWidgetModule
67
import app.k9mail.feature.widget.unread.UnreadWidgetUpdateListener
78
import app.k9mail.feature.widget.unread.unreadWidgetModule
@@ -10,7 +11,6 @@ import com.fsck.k9.backends.backendsModule
1011
import com.fsck.k9.controller.ControllerExtension
1112
import com.fsck.k9.crypto.EncryptionExtractor
1213
import com.fsck.k9.crypto.openpgp.OpenPgpEncryptionExtractor
13-
import com.fsck.k9.feature.featureLauncherModule
1414
import com.fsck.k9.notification.notificationModule
1515
import com.fsck.k9.preferences.K9StoragePersister
1616
import com.fsck.k9.preferences.StoragePersister

legacy/common/src/main/java/com/fsck/k9/feature/NavigationDrawerConfigLoader.kt

-12
This file was deleted.

settings.gradle.kts

-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ include(
164164
":legacy:di",
165165
":legacy:mailstore",
166166
":legacy:message",
167-
":legacy:preferences",
168167
":legacy:search",
169168
":legacy:storage",
170169
":legacy:testing",

0 commit comments

Comments
 (0)