Allow creating a submission with string or list of strings for packageName
#1491
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a bit of follow on work to the changes for #1367.
These changes allow a client to create a new submission using either a list of strings or single string for the
packageName
field. The reason for this comes down to the fact that the release cycle for the Field Notes app is decoupled from thenmdc-server
release cycle (by necessity, due to app store review delays).The app already knows how to deal with
packageName
values coming from the server that are either string or lists of strings. But when creating a new submission, the app doesn't know a priori whether the server will accept a single string or an array of strings for thepackageName
. We will release an update to the app to make it send an array of strings by default, but it will take a little bit of time to get that change into user devices. In the meantime the app will continue sending a single stringpackageName
for new submissions, and these backend changes will help ease that transition period.P.S. In the future I'd like to use the information from the
/api/version
endpoint to make decisions in the app about which features the server supports. Hopefully that will mean fewer backend changes like this in the future. But it'll take a bit of architectural work in the app to do that, and that sadly isn't the top priority at the moment.