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

Cannot create Study within app #230

Closed
eecavanna opened this issue Feb 17, 2025 · 5 comments · Fixed by #232
Closed

Cannot create Study within app #230

eecavanna opened this issue Feb 17, 2025 · 5 comments · Fixed by #232
Assignees
Labels
beta-feedback Related to feedback received from beta testers bug Something isn't working ios-app 🍎 Related to the iOS client user-submitted Submitted by someone not in the NMDC Field Notes squad v1-release 🚀 Features and bug fixes that must be included in the first public release (i.e. general release)

Comments

@eecavanna
Copy link
Collaborator

eecavanna commented Feb 17, 2025

Bug summary

Cannot create Study within app

Bug details

Using the latest beta version of the iOS app, I am unable to create a Study via the app. I'm tagging this issue with user-submitted because the issue was originally reported by a beta tester. I am creating this ticket after (a) receiving that report and then (b) reproducing it.

Steps to reproduce

  1. Launch app
  2. Tap on "Studies" tab to go to "Studies" screen
  3. Tap on "New" to go to "New Study" screen
  4. Fill in all required fields (i.e. "Name", "Email", and "Templates") and tap "Save"
  5. Notice the "New Study" screen remains visible
  6. Tap "Back" to return to the "Studies" screen
  7. Notice the newly-created Study is not listed, even after pulling down to refresh the list

If you have access to the logs of our API server, notice that the server is responding to the API request at step 4 with an HTTP 422 response.

Anything else?

  • I observed this when using iOS 18.1.1 (on an iPhone 12 Pro).
  • A beta tester reported it when using iOS 17.5.1 (on an iPhone SE 3rd generation).
  • I had Internet access at the time.

As a workaround, I confirmed I could create a Study via the NMDC Submission Portal; then — back in the NMDC Field Notes app — reload the "Studies" list (by dragging the list downward), and see the newly-created Study there.

App version

0.1.0 (9)

Device type

Apple

Operating system version

iOS 18.1.1

@eecavanna eecavanna added beta-feedback Related to feedback received from beta testers bug Something isn't working ios-app 🍎 Related to the iOS client user-submitted Submitted by someone not in the NMDC Field Notes squad v1-release 🚀 Features and bug fixes that must be included in the first public release (i.e. general release) labels Feb 17, 2025
@eecavanna
Copy link
Collaborator Author

eecavanna commented Feb 18, 2025

Here's what I see in the logs of the portal-frontend deployment (on Rancher) when I tap the "Save" button within the app (at the end of Step 4 in the issue description).

2025-02-17T23:00:19.347544688Z 10.42.8.36 - - [17/Feb/2025:23:00:19 +0000] "POST /api/metadata_submission HTTP/1.1" 422 2
26 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 18_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"

I want to emphasize that the response code is 422, which MDN describes as:

The HTTP 422 Unprocessable Content client error response status code indicates that the server understood the content type of the request content, and the syntax of the request content was correct, but it was unable to process the contained instructions.

@eecavanna
Copy link
Collaborator Author

eecavanna commented Feb 18, 2025

I told the beta tester that initially reported this issue to me, that I would close the loop with them via email once this issue gets resolved. I'm posting this comment as a reminder to myself to do that. I also sent them a link to this ticket, so they may already be aware of its resolution before I send that email.

@eecavanna
Copy link
Collaborator Author

eecavanna commented Feb 18, 2025

On my iPhone 12 Pro, I reverted to the previous build of the app (i.e. 0.1.0 (8)) and confirmed I still see this issue there. I did the same with the previous-previous build (i.e. 0.1.0 (7)) and confirmed I still see the issue there, too. So, I don't think this was introduced in the latest build (i.e. 0.1.0 (9)).

I am wondering whether something changed on the nmdc-server side (e.g. in the early-February NMDC release) that is preventing these API requests from being processed; possibly something related to the ability to create "test" submissions. Whatever it is does not seem to me to be impacting the Submission Portal, since I was able to create a Study through that client OK.

CC: @pkalita-lbl

@pkalita-lbl pkalita-lbl self-assigned this Feb 18, 2025
@pkalita-lbl pkalita-lbl moved this from Todo to In Progress in 2025 - Sprint 56 - Feb 10-21,2025 Feb 18, 2025
@pkalita-lbl pkalita-lbl moved this from Todo to In Progress in Field Notes Squad Board Feb 18, 2025
@pkalita-lbl
Copy link
Collaborator

This is reproducible in my local development environment. The full error response is:

{
    "detail": [
        {
            "type": "missing",
            "loc": [
                "body",
                "metadata_submission",
                "addressForm",
                "shipper",
                "country"
            ],
            "msg": "Field required",
            "input": {
                "city": "",
                "email": "",
                "line1": "",
                "line2": "",
                "name": "",
                "phone": "",
                "postalCode": "",
                "state": ""
            }
        }
    ]
}

Looks like we need to now include a country value (even if it's just an empty string), as introduced by microbiomedata/nmdc-server#1506.

@eecavanna
Copy link
Collaborator Author

The fix for this issue was included in build 10 of version 0.1.0. That build was released on TestFlight on Tuesday, February 18.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-feedback Related to feedback received from beta testers bug Something isn't working ios-app 🍎 Related to the iOS client user-submitted Submitted by someone not in the NMDC Field Notes squad v1-release 🚀 Features and bug fixes that must be included in the first public release (i.e. general release)
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants