Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #492 from fieldsight/491/bugfix-stuck-at-queued
Browse files Browse the repository at this point in the history
clears project map; resets queue to complete (#491)
  • Loading branch information
yubarajpoudel authored Nov 27, 2019
2 parents 164f82d + efd5763 commit 09cc88a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ public void onComplete() {
removeFormsAndInstances(context, deletedForms -> {
ServiceGenerator.clearInstance();
SyncRepository.instance = null;
Collect.syncableMap = null;
Collect.selectedProjectList = null;
logoutListener.logoutTaskSuccess();
logoutListener.taskComplete();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,21 @@ public Observable<Pair<FieldsightFormDetailsv3, String>> getFormUsingProjectId(L
.doOnNext(new Consumer<ArrayList<FieldsightFormDetailsv3>>() {
@Override
public void accept(ArrayList<FieldsightFormDetailsv3> fieldSightFormDetails) {

String[] projectIds = new String[projects.size()];
for (int i = 0; i < projects.size(); i++) {
projectIds[i] = projects.get(i).getId();
}

FieldSightFormsLocalSourcev3.getInstance().updateAll(fieldSightFormDetails, projectIds);
if (fieldSightFormDetails.isEmpty()) {
for (String projectId : projectIds) {
SyncLocalSource3.getInstance().markAsCompleted(String.valueOf(projectId), 1);
}
} else {
FieldSightFormsLocalSourcev3.getInstance().updateAll(fieldSightFormDetails, projectIds);
}


}
})
.flatMap((Function<ArrayList<FieldsightFormDetailsv3>, ObservableSource<Pair<FieldsightFormDetailsv3, String>>>) fieldSightFormDetails -> {
Expand Down

0 comments on commit 09cc88a

Please sign in to comment.