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

fix: [1.10.1-RC] Port changes in master #2205

Merged
merged 6 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void filter_d2_error_by_d2_error_code() {
public void filter_d2_error_by_d2_error_component() {
List<D2Error> d2Errors = d2.maintenanceModule().d2Errors()
.byD2ErrorComponent().eq(D2ErrorComponent.Server).blockingGet();
assertThat(d2Errors.size()).isEqualTo(2);
assertThat(d2Errors.size()).isEqualTo(4);
}

@Test
Expand Down Expand Up @@ -105,6 +105,6 @@ public void filter_d2_error_by_created() {
List<D2Error> d2Errors = d2.maintenanceModule().d2Errors()
.byCreated().inPeriods(Lists.newArrayList(todayPeriod)).blockingGet();

assertThat(d2Errors.size()).isEqualTo(3);
assertThat(d2Errors.size()).isEqualTo(5);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,6 @@ public void get_vulnerabilities_for_low_threshold() {
@Test
public void allow_access_to_d2_errors() {
List<D2Error> d2Errors = d2.maintenanceModule().d2Errors().blockingGet();
assertThat(d2Errors.size()).isEqualTo(3);
assertThat(d2Errors.size()).isEqualTo(5);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class TrackedEntityAttributeValueCollectionRepositoryMockIntegrationShoul
public void allow_access_to_all_tracked_entity_data_values() {
List<TrackedEntityAttributeValue> trackedEntityAttributeValues =
d2.trackedEntityModule().trackedEntityAttributeValues().blockingGet();
assertThat(trackedEntityAttributeValues.size()).isEqualTo(3);
assertThat(trackedEntityAttributeValues.size()).isEqualTo(4);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ public void include_tracked_entity_attribute_values_as_children() {
TrackedEntityInstance tei = d2.trackedEntityModule().trackedEntityInstances()
.withTrackedEntityAttributeValues().uid("nWrB0TfWlvD").blockingGet();

assertThat(tei.trackedEntityAttributeValues().size()).isEqualTo(1);
assertThat(tei.trackedEntityAttributeValues().size()).isEqualTo(2);


assertThat(tei.trackedEntityAttributeValues().get(0).trackedEntityAttribute()).isEqualTo("cejWyOfXge6");
assertThat(tei.trackedEntityAttributeValues().get(0).value()).isEqualTo("654321");
assertThat(tei.trackedEntityAttributeValues().get(0).trackedEntityAttribute()).isEqualTo("aejWyOfXge6");
assertThat(tei.trackedEntityAttributeValues().get(0).value()).isEqualTo("aefryrfXge5");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class TrackedEntitySearchCollectionRepositoryMockIntegrationShould :
.blockingGet()

assertThat(trackedEntityInstances[0].header).isEqualTo("4081507, befryEfXge5")
assertThat(trackedEntityInstances[1].header).isEqualTo("654321, ")
assertThat(trackedEntityInstances[1].header).isEqualTo("654321, aefryrfXge5")
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import org.hisp.dhis.android.core.arch.call.fetchers.internal.UidsNoResourceCall
import org.hisp.dhis.android.core.arch.call.internal.D2ProgressManager
import org.hisp.dhis.android.core.arch.call.queries.internal.UidsQuery
import org.hisp.dhis.android.core.arch.helpers.FileResizerHelper
import org.hisp.dhis.android.core.arch.helpers.Result
import org.hisp.dhis.android.core.common.State
import org.hisp.dhis.android.core.common.ValueType
import org.hisp.dhis.android.core.fileresource.FileResource
Expand Down Expand Up @@ -253,12 +254,20 @@ internal class FileResourceDownloadCall(
private suspend fun <V> getIdsValuePairsSequentially(valueMap: Map<String?, V>): List<Pair<FileResource, V>> {
return valueMap.mapNotNull { (uid, value) ->
uid?.let {
val fileResource = coroutineAPICallExecutor.wrap {
val frResult = coroutineAPICallExecutor.wrap {
fileResourceService.getFileResource(
uid,
)
}.getOrThrow()
Pair(fileResource, value)
}
when (frResult) {
is Result.Success -> {
Pair(frResult.value, value)
}
is Result.Failure -> {
Log.v(FileResourceDownloadCall::class.java.canonicalName, frResult.failure.errorDescription())
null
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@
"createdAt": "2018-01-10T13:40:28.000",
"attribute": "cejWyOfXge6",
"value": "654321"
},
{
"updatedAt": "2019-01-11T13:40:28.000",
"createdAt": "2019-01-11T13:40:28.000",
"attribute": "aejWyOfXge6",
"value": "aefryrfXge5"
}
],
"enrollments": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,12 @@
"created": "2018-01-10T13:40:28.000",
"attribute": "cejWyOfXge6",
"value": "654321"
},
{
"lastUpdated": "2019-01-11T13:40:28.000",
"created": "2019-01-11T13:40:28.000",
"attribute": "aejWyOfXge6",
"value": "aefryrfXge5"
}
],
"enrollments": [
Expand Down
2 changes: 1 addition & 1 deletion docs/content/developer/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Include dependency in build.gradle.

```gradle
dependencies {
implementation "org.hisp.dhis:android-core:1.10.0.1"
implementation "org.hisp.dhis:android-core:1.10.1"
...
}
```
Expand Down