bcgov / invasivesBC-mussels-iOS

Apache License 2.0
0 stars 4 forks source link

Triage missing data in Inspection Form #300

Closed LocalNewsTV closed 4 months ago

LocalNewsTV commented 4 months ago

Describe the Bug Users are submitting Inspections where some details are missing (Watercraft Journeys)

Expected Behaviour These fields should be enforced by validation (Though its known that the user can force close the application to bypass)

Actual Behaviour At least two records have been submitted where no previous waterbody detail was listed, on a High Risk entry.

Implications Due to the nature of the app, high risk inspections that are missing details could be potentially harmful.

Steps to reproduce

Additional Details

LocalNewsTV commented 4 months ago

This bug is not a new bug, but a recurring issue over several years

Exploratory Results

Recommended Actions

iOS App sends each record individually as seen in the screenshot

Image

Line by the line the flow is:

  1. Get my information local to the database (for created by fields)
  2. Create a shift entry and return the entry #
  3. submit one Watercraft Assessment Report (WRA)
  4. Submit the blowbys (Assuming these requests are potentially asynchronous
  5. Submit another WRA (Repeat process for n WRA)

This path forward bears in mind the SDK still needs to be updated for iOS and we are currently in the On-season so while the app is still in a stable state, avoiding potentially breaking updates is a priority

State as of writing

LocalNewsTV commented 4 months ago

For the technical person who falls back on this ticket:

In the Lucy database, the post request for Inspections is located in api->api_sources->sources->server->modules->forms->watercraftRiskAssessment->watercraftRiskAssessment.route.ts

The POST handler is createResource at this time located on line 96

Probably course of action is to add a validation function on line 97 that throws an error on failure, to communicate with the frontend.