Skip to content

Commit

Permalink
Apollo: Release source code for 52.2
Browse files Browse the repository at this point in the history
  • Loading branch information
acrespo committed Sep 23, 2024
1 parent f9efc3b commit 2c0772a
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 11 deletions.
6 changes: 6 additions & 0 deletions android/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ follow [https://changelog.md/](https://changelog.md/) guidelines.

## [Unreleased]

## [52.2] - 2024-09-23

### FIXED

- Visual bug that prevent display of some of the oldest payments in payment history

## [52.1] - 2024-08-02

### ADDED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
import io.muun.apollo.domain.action.operation.CreateOperationAction;
import io.muun.apollo.domain.action.operation.OperationMetadataMapper;
import io.muun.apollo.domain.model.Operation;
import io.muun.apollo.domain.model.OperationWithMetadata;
import io.muun.common.rx.RxHelper;

import rx.Observable;
import timber.log.Timber;

import java.util.List;
import javax.inject.Inject;
import javax.inject.Singleton;

Expand All @@ -27,10 +29,12 @@ public class OperationActions {
* Constructor.
*/
@Inject
public OperationActions(CreateOperationAction createOperation,
OperationDao operationDao,
HoustonClient houstonClient,
OperationMetadataMapper operationMapper) {
public OperationActions(
CreateOperationAction createOperation,
OperationDao operationDao,
HoustonClient houstonClient,
OperationMetadataMapper operationMapper
) {

Timber.d("[OperationActions] Execute Dependency Injection");

Expand All @@ -48,11 +52,30 @@ public Observable<Void> fetchReplaceOperations() {

return operationDao.deleteAll().andThen(
houstonClient.fetchOperations()
.flatMap(Observable::from)
// using concatMap to avoid parallelization, overflows JobExecutor's queue
// TODO use batching
.map(operationMapper::mapFromMetadata)
.concatMap(createOperation::saveOperation)
.doOnNext(list -> Timber.i("Received op history: size " + list.size()))
.buffer(20)
.flatMap(chunks -> {

// Hack warning: we can't use flatMap (parallelization breaks
// JobExecutor threadpool capacity) nor concatMap (suddenly stops
// processing events from Observable.from() silently) directly.
// So we introduce some "parallel processing by batches".
// TODO we should really migrate to using batching Sqlite inserts
// instead of inserting one-by-one

for (List<OperationWithMetadata> chunk : chunks) {
if (!chunk.isEmpty()) {
Observable.from(chunk)
.doOnNext(op -> Timber.i("processing op:" + op.getId()))
.map(operationMapper::mapFromMetadata)
.flatMap(createOperation::saveOperation, 5)
.toBlocking()
.last();
}
}

return Observable.just(null);
})
.lastOrDefault(null)
.map(RxHelper::toVoid)
);
Expand Down
4 changes: 2 additions & 2 deletions android/apolloui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ android {
applicationId "io.muun.apollo"
minSdk 19
targetSdk 34
versionCode 1201
versionName "52.1"
versionCode 1202
versionName "52.2"

// Needed to make sure these classes are available in the main DEX file for API 19
// See: https://spin.atomicobject.com/2018/07/16/support-kitkat-multidex/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ public enum OperationStatus {
/**
* Operation with its transaction present in a block (0 < confirmations < SETTLEMENT_NUMBER),
* but not with enough transactions to be settled.
* TODO: the semantics for this status are no longer accurate (for instance, fulfilled
* incoming swaps are CONFIRMED whenever the preimage is revealed, regardless of the
* confirmation status of any transaction).
*/
CONFIRMED,

Expand Down

0 comments on commit 2c0772a

Please sign in to comment.