Skip to content

Commit

Permalink
Merge pull request #1407 from dimagi/dupe_of_stackFrameExtras
Browse files Browse the repository at this point in the history
[Duplicate ]fix query step extras to not have a list of list
  • Loading branch information
shubham1g5 authored May 3, 2024
2 parents df155f0 + 162a3bf commit 96803bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/commcare/suite/model/StackFrameStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public StackFrameStep defineStep(EvaluationContext ec, SessionDatum neededDatum)
StackFrameStep defined = new StackFrameStep(elementType, id, evaluateValue(ec));
extras.forEach((key, value) -> {
if (value instanceof QueryData) {
defined.addExtra(key, ((QueryData)value).getValues(ec));
defined.getExtras().putAll(key, ((QueryData)value).getValues(ec));
} else if (value instanceof XPathExpression) {
// only to maintain backward compatibility with old serialised app db state, can be removed in
// subsequent deploys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,10 @@ public void stackWithQueries() throws Exception {
StackFrameStep queryFrame = steps.get(2);
assertEquals(SessionFrame.STATE_QUERY_REQUEST, queryFrame.getElementType());

ImmutableMultimap.Builder<String, ImmutableList> builder = ImmutableMultimap.builder();
builder.put("case_type", ImmutableList.of("patient"));
builder.put("x_commcare_data_registry", ImmutableList.of("test"));
builder.put("case_id", ImmutableList.of("case_one"));
builder.put("case_id", ImmutableList.of("dupe1"));
ImmutableMultimap.Builder<String, String> builder = ImmutableMultimap.builder();
builder.put("case_type", "patient");
builder.put("x_commcare_data_registry", "test");
builder.putAll("case_id", ImmutableList.of("case_one", "dupe1"));
assertEquals(builder.build(), queryFrame.getExtras());
}
}

0 comments on commit 96803bf

Please sign in to comment.