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

Support Endpoints for Instance Datums #1312

Merged
merged 16 commits into from
Aug 16, 2023
Merged

Support Endpoints for Instance Datums #1312

merged 16 commits into from
Aug 16, 2023

Conversation

shubham1g5
Copy link
Contributor

See dimagi/formplayer#1431

Special deploy instructions

  • Corresponding FP PR will need to be reverted if we revert this.

Rollback instructions

  • This PR can be reverted after deploy with no further considerations.

Review

  • The set of people pinged as reviewers is appropriate for the level of risk of the change.

Duplicate PR

Automatically duplicate this PR as defined in contributing.md.

throw new InvalidStructureException(
"argument containing a non-null instance-id must define an instance-src", parser);
}
arguments.add(new EndpointArgument(argumentID, argInstanceId, argInstanceSrc));
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to make sure I understand correctly, is the idea here that EndpointArgument also handles single case selection where <argument id="case_id"/>? So if there is no argInstanceId and no argInstanceSrc the functionality from this point is essentially the same as before.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, spot on.

Vector<String> missingArguments = new Vector<String>(endpointArguments.subList(args.size(), endpointArguments.size()));
Vector<String> missingArguments = new Vector<>();
for (int i = args.size(); i < endpointArguments.size(); i++) {
missingArguments.add(endpointArguments.get(i).getId());
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you always depend on the ordering of args and endpointArguments to match up? I see that it was working with the same logic before when calling endpointArguments.subList, but not clear how the ordering works.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah we expect the arguments to be passed in order when it's passed as a list without using the argument keys (arg1=val1&arg2=val2 vs val1,val2). Web Apps uses the fuirst format with names but Android can use both those formats. The ordering matters only in the later format.

@shubham1g5 shubham1g5 marked this pull request as ready for review August 10, 2023 19:43
storageReferenceId = guid;
}

private void validateEntitiesInInstance(ExternalDataInstance instance) throws CommCareSessionException {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is currently an issue with this validation that I am verifying with delivery

@shubham1g5
Copy link
Contributor Author

duplicate this PR

@shubham1g5 shubham1g5 merged commit b4bf943 into formplayer Aug 16, 2023
2 checks passed
@shubham1g5 shubham1g5 deleted the instanceEndpoint branch August 16, 2023 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants