Skip to content

Conversation

@xavimolloy
Copy link
Collaborator

No description provided.

github-actions bot and others added 30 commits October 21, 2025 10:55
* feat: [ANDROAPP-7288] implement DomainError handling and UseCase interface

* feat: [ANDROAPP-7288] implement UseCase plus domain error in ValidatePinUseCase.kt and ForgotPinUseCase.kt

* Update PinViewModelTest

* fix: update import statements and simplify error handling in ValidatePinUseCaseTest

* feat: add documentation for DomainError and DomainErrorMapper classes

* feat: update copilot instructions to include UseCase interface implementation and error handling

* feat: update copilot instructions to use launchUseCase for coroutine tracking

* feat: enhance copilot instructions for SDK exception mapping and error handling

* feat: update copilot instructions to include comprehensive development guidelines and best practices

* feat: update copilot instructions to include error handling example with DomainErrorMapper
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.6.2 to 5.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v4.6.2...v5.0.0)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* fix: update output setting in GitHub Actions workflows

* refactor: clean up unused imports and improve keyboard close handling
…h-release-3.3.0

# Conflicts:
#	gradle/libs.versions.toml
#	login/src/androidMain/kotlin/org/dhis2/mobile/login/pin/data/SessionRepositoryImpl.kt
#	login/src/androidMain/kotlin/org/dhis2/mobile/login/pin/di/PinModule.android.kt
update-develop-with-release-3.3.0 [skip size]
* feat: [ANDROAPP-7288] implement UseCase plus domain error in ValidatePinUseCase.kt and ForgotPinUseCase.kt

* feat: add documentation for DomainError and DomainErrorMapper classes

* fix: remove unused imports in CredentialsViewModel.kt
* refactor: improve error handling in LogoutUser and HomeRepository

* test: enhance LogoutUser tests for domain and non-domain error handling

* refactor: improve LogoutUser use case error handling and streamline session management

* test: enhance SettingsProgramViewModel tests to handle initial empty emissions
* fix(translations): update language mappings and file paths for Transifex integration

Signed-off-by: andresmr <[email protected]>

* fix(translations): update various strings for improved clarity and consistency across multiple languages

Signed-off-by: andresmr <[email protected]>

* fix(config): add resource names for various string files to improve clarity

Signed-off-by: andresmr <[email protected]>

---------

Signed-off-by: andresmr <[email protected]>
…ize] (#4491)

* fix(translations): sync translations from transifex (develop)

* fix(translations): sync translations from transifex (develop)

WARNING: This automated sync from transifex removed more lines than it added.
Please check carefully before merging!

* fix(translations): escape ampersands in loading messages for proper rendering

Signed-off-by: andresmr <[email protected]>

---------

Signed-off-by: andresmr <[email protected]>
Co-authored-by: andresmr <[email protected]>
* fix(translations): sync translations from transifex (develop)

* fix(translations): sync translations from transifex (develop)
# Conflicts:
#	app/src/androidTest/java/org/dhis2/common/BaseRobot.kt
#	stock-usecase/src/main/res/values/strings.xml
#	tracker/src/commonMain/composeResources/values-ar-rEG/strings.xml
#	tracker/src/commonMain/composeResources/values-ar-rIQ/strings.xml
#	tracker/src/commonMain/composeResources/values-ar/strings.xml
#	tracker/src/commonMain/composeResources/values-ckb/strings.xml
#	tracker/src/commonMain/composeResources/values-cs/strings.xml
#	tracker/src/commonMain/composeResources/values-es-rES/strings.xml
#	tracker/src/commonMain/composeResources/values-fr/strings.xml
#	tracker/src/commonMain/composeResources/values-hi-rIN/strings.xml
#	tracker/src/commonMain/composeResources/values-id/strings.xml
#	tracker/src/commonMain/composeResources/values-ko-rKR/strings.xml
#	tracker/src/commonMain/composeResources/values-lo/strings.xml
#	tracker/src/commonMain/composeResources/values-nb/strings.xml
#	tracker/src/commonMain/composeResources/values-ne/strings.xml
#	tracker/src/commonMain/composeResources/values-nl/strings.xml
#	tracker/src/commonMain/composeResources/values-prs/strings.xml
#	tracker/src/commonMain/composeResources/values-pt-rBR/strings.xml
#	tracker/src/commonMain/composeResources/values-ro/strings.xml
#	tracker/src/commonMain/composeResources/values-si/strings.xml
#	tracker/src/commonMain/composeResources/values-uz/strings.xml
update-develop-with-3.3.0 [skip size]
# Conflicts:
#	app/src/main/java/org/dhis2/usescases/main/HomeRepositoryImpl.kt
#	app/src/main/java/org/dhis2/usescases/main/MainModule.kt
#	gradle/libs.versions.toml
#	tracker/src/commonMain/composeResources/values-nl/strings.xml
Update develop with Release/3.3.0 [skip size]
* build: [ANDROAPP-7337] [1/2] Home repository new architecture

* fix: provide a descriptive message for IllegalStateException in HomeRepositoryImpl

Signed-off-by: andresmr <[email protected]>

* fix: [ANDROAPP-7337] Fix sonarcloud code smell

---------

Signed-off-by: andresmr <[email protected]>
Co-authored-by: andresmr <[email protected]>
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* fix: [ANDROAPP-7393] Delete cryptographic key when second account is added

* fix: [ANDROAPP-7393] refactor code and add testing

* chore: [ANDROAPP-7393] login user unit tests

* Update login/src/commonTest/kotlin/org/dhis2/mobile/login/main/domain/usecase/LoginUserTest.kt

Co-authored-by: Copilot <[email protected]>

* Update login/src/commonTest/kotlin/org/dhis2/mobile/login/main/domain/usecase/LoginUserTest.kt

Co-authored-by: Copilot <[email protected]>

* fix: [ANDROAPP-7393] update tests

* fix: [ANDROAPP-7393] ktlint

* fix: [ANDROAPP-7393] Delete cryptographic key when second account is added

* fix: [ANDROAPP-7393] refactor code and add testing

* chore: [ANDROAPP-7393] login user unit tests

* fix: [ANDROAPP-7393] update tests

* Update login/src/commonTest/kotlin/org/dhis2/mobile/login/main/domain/usecase/LoginUserTest.kt

Co-authored-by: Copilot <[email protected]>

* Update login/src/commonTest/kotlin/org/dhis2/mobile/login/main/domain/usecase/LoginUserTest.kt

Co-authored-by: Copilot <[email protected]>

* fix: [ANDROAPP-7393] fix test

---------

Co-authored-by: Copilot <[email protected]>
* fix: [ANDROAPP-7388] Create Sync module

* fix: [ANDROAPP-7388] Add resource files and transifex support

* Update sync/src/androidHostTest/kotlin/org/dhis2/mobile/sync/ExampleUnitTest.kt

Co-authored-by: Copilot <[email protected]>

* Update sync/src/androidDeviceTest/kotlin/org/dhis2/mobile/sync/ExampleInstrumentedTest.kt

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
Balcan and others added 13 commits December 18, 2025 07:19
…4560)

* fix: [ANDROAPP-7386] Remove AlertDialog from SyncManagerFragment

* fix: [ANDROAPP-7386] Remove AlertDialog from MainActivity

* fix: [ANDROAPP-7386] Remove AlertDialog from ExportOption

* fix: [ANDROAPP-7386] Remove AlertDialog

* fix: [ANDROAPP-7386] Move Form imageVector to app

* fix: [ANDROAPP-7386] Move LoadingIcon to commons

* fix: [ANDROAPP-7386] Move SyncStatusItem to app

* fix: [ANDROAPP-7386] Remove Color from ui components

* fix: [ANDROAPP-7386] Remove ButtonUiModel from ui components
# Conflicts:
#	app/src/main/res/values-cs/strings.xml
#	app/src/main/res/values-hi-rIN/strings.xml
#	commons/src/main/res/values-hi-rIN/strings.xml
#	gradle/libs.versions.toml
#	stock-usecase/src/main/res/values-cs/strings.xml
#	stock-usecase/src/main/res/values-fr/strings.xml
#	stock-usecase/src/main/res/values-nb/strings.xml
#	stock-usecase/src/main/res/values-sv/strings.xml
#	stock-usecase/src/main/res/values-tet/strings.xml
#	stock-usecase/src/main/res/values-tg/strings.xml
#	stock-usecase/src/main/res/values-uk/strings.xml
…ts (#4565)

* fix: [ANDROAPP-7428] Filter by events only linked to active enrollments

* fix: [ANDROAPP-7428] fix unit tests
* ci: set up Sentry gradle to upload proguard files

* ci: set environment SENTRY_AUTH_TOKEN in Github actions

* ci: set environment SENTRY_AUTH_TOKEN in Github actions

* ci: add sentry version and check for SENTRY_AUTH_TOKEN

Signed-off-by: Manu Muñoz <[email protected]>

* restore training

Signed-off-by: Manu Muñoz <[email protected]>

* build: disable Sentry auto-installation and source context upload

- Disable auto-installation of Sentry components in the build configuration.
- Disable source context inclusion to prevent uploading source code to Sentry.

---------

Signed-off-by: Manu Muñoz <[email protected]>
Co-authored-by: Manu Muñoz <[email protected]>
* fix(reporting): remove user tracking from crash reports

* Fix flaky DataSetTest
…4581)

* chore: [ANDROAPP-7442] Don't filter by completed enrollments for program rule triggering

* chore: [ANDROAPP-7442] ktlint
Copilot AI review requested due to automatic review settings January 14, 2026 08:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This is a release PR (v3.3.1) that includes dependency updates, a new sync module scaffold, architecture improvements, and various bug fixes across the codebase. The changes focus on migrating to Kotlin Multiplatform patterns, improving error handling, and cleaning up deprecated code.

Changes:

  • Added new sync KMP module with platform-specific implementations and localization scaffolding
  • Refactored login PIN validation to use standard UseCase pattern with Result<T> and domain errors
  • Updated form module with better focus handling, synchronized idling resources, and fixed data integrity checks
  • Enhanced stock-usecase and program rules to filter active enrollments only and simplified option handling
  • Migrated UI components away from custom theme colors to Material3/DHIS2 design system colors

Reviewed changes

Copilot reviewed 200 out of 202 changed files in this pull request and generated no comments.

Show a summary per file
File Description
gradle/libs.versions.toml Version bumps: SDK 1.13.1, design system 0.6.1, Kotlin 2.2.21, Gradle 8.13.2, Sentry 8.29.0
sync/* New KMP module scaffold with platform implementations and empty localization files
login/pin/* Refactored to UseCase pattern with Result, replaced PinResult sealed class with PinError
form/* Added onFocusChanged handling, synchronized FormCountingIdlingResource, fixed context data detection
stock-usecase/* Added enrollment status filtering to only process ACTIVE enrollments
dhis2-mobile-program-rules/* Simplified toRuleDataValue/toRuleAttributeValue, removed complex option mapping
commonskmm/* Added DomainError hierarchy and DomainErrorMapper for structured error handling
app/main/* Refactored HomeRepository to suspend functions with error mapping, improved logout flow
ui-components/* Removed deprecated Color.kt, ButtonUiModel, AlertDialog - migrated to design system
app/teiDashboard/* Made currentProgram() nullable, added null safety throughout

@xavimolloy xavimolloy changed the title build: Release 3.3.1 build: Release 3.3.1 [skip size] Jan 14, 2026
Copilot AI review requested due to automatic review settings January 15, 2026 15:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 202 out of 204 changed files in this pull request and generated 6 comments.

Comment on lines +10 to +12
suspend fun logOut()

suspend fun clearPin()
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The interface methods logOut(), clearPin(), wipeAll(), and deleteCurrentAccount() should return Result<Unit> to align with the new domain error handling pattern. The implementation in HomeRepositoryImpl wraps these in execute which can throw DomainError, but callers like LogoutUser need to handle failures properly. Currently clearSessionLock() in the usage returns Result, but this interface doesn't declare it.

Copilot uses AI. Check for mistakes.
headerTextAlignment = TextAlign.Center,
animateHeaderOnKeyboardAppearance = false,
scrollableContainerMinHeight = Spacing.Spacing40,
scrollableContainerMaxHeight = Spacing.Spacing840,
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded maximum height value Spacing.Spacing840 appears to be a magic number. Consider adding a comment explaining why this specific value was chosen or making it a named constant with semantic meaning (e.g., PIN_SHEET_MAX_HEIGHT).

Copilot uses AI. Check for mistakes.
Comment on lines +108 to +109
val flagRes = resources.getIdentifier(flagName, "drawable", packageName)
binding.logoFlag.setImageResource(flagRes)
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If getIdentifier returns 0 (resource not found), setImageResource(0) will clear the image but won't set the visibility to GONE. Should check if flagRes != 0 before setting the resource, otherwise set visibility to GONE like in the else branch.

Copilot uses AI. Check for mistakes.
ownerOrgUnit,
) {
fun currentProgram(): Program = enrollmentPrograms.first { it.first.uid() == currentEnrollment.program() }.first
fun currentProgram(): Program? = enrollmentPrograms.firstOrNull { it.first.uid() == currentEnrollment.program() }?.first
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function signature changed from returning non-null Program to nullable Program?, but the name currentProgram() doesn't indicate optionality. This breaking change means all call sites need to handle null, which could lead to crashes if not all callers were updated. Consider renaming to currentProgramOrNull() to make the optionality explicit.

Copilot uses AI. Check for mistakes.
Comment on lines +842 to +850
if (!searchItem.getProgramOwners().isEmpty() &&
searchItem.getProgramOwners().get(0).getOwnerOrgUnit().equals(searchItem.getOrganisationUnit())) {
searchTei.setEnrolledOrgUnit(orgUnitName(searchTei.getTei().organisationUnit()));
} else {
searchTei.setEnrolledOrgUnit(orgUnitName(searchTei.getTei().organisationUnit()));
if (!searchItem.getProgramOwners().isEmpty()) {
searchTei.setOwnerOrgUnit(orgUnitName(searchItem.getProgramOwners().get(0).getOwnerOrgUnit()));
}
}
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both branches of the if-else statement set searchTei.setEnrolledOrgUnit(orgUnitName(searchTei.getTei().organisationUnit())) to the same value. This duplicated logic can be simplified by extracting it outside the conditional block.

Copilot uses AI. Check for mistakes.
ValueStoreResult.VALUE_CHANGED -> {
result.first.let {
_savedValue.value = it
_savedValue.postValue(it)
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed from _savedValue.value = it to _savedValue.postValue(it). The postValue method is thread-safe but posts to the main thread. However, this is being called from a flow that's already on dispatcher.io(). Using postValue here is correct for thread safety, but ensure this matches the intended behavior since it will delay the update until the next main thread cycle.

Copilot uses AI. Check for mistakes.
* Update version code, sdk, and design system release version

* chore: Update version name

---------

Co-authored-by: @dhis2-bot <[email protected]>
Co-authored-by: Xavier Molloy <[email protected]>
@sonarqubecloud
Copy link

Copilot AI review requested due to automatic review settings January 16, 2026 08:46
@xavimolloy xavimolloy merged commit d87193d into main Jan 16, 2026
5 of 7 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 190 out of 192 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

commons/src/main/java/org/dhis2/commons/ui/icons/LoadingIcon.kt:1

  • Fixed incorrect package name. Changed from 'org.dhis2.ui.icons' to 'org.dhis2.commons.ui.icons' to match the actual file location.
    app/src/main/java/org/dhis2/utils/granularsync/SyncStatusItem.kt:1
  • Fixed incorrect package name. Changed from 'org.dhis2.ui.items' to 'org.dhis2.utils.granularsync' to match the actual file location.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +506 to +515
fun List<TrackedEntityDataValue>.toRuleDataValue(): List<RuleDataValue> =
mapNotNull {
val dataElement = it.dataElement() ?: return@mapNotNull null
it.value()?.let { value ->
RuleDataValue(
dataElement = dataElement,
value = value,
)
}
RuleDataValue(
dataElement = it.dataElement()!!,
value = value!!,
)
}.filter { it.value.isNotEmpty() }
}
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplified toRuleDataValue function by removing complex option name/code mapping logic and unnecessary repository parameters. The function now has a cleaner signature and focuses on core data transformation.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants