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

Tighten Validation Loophole in Inspections #313

Open
3 of 5 tasks
LocalNewsTV opened this issue Jun 4, 2024 · 0 comments · May be fixed by #318
Open
3 of 5 tasks

Tighten Validation Loophole in Inspections #313

LocalNewsTV opened this issue Jun 4, 2024 · 0 comments · May be fixed by #318
Assignees

Comments

@LocalNewsTV
Copy link
Collaborator

LocalNewsTV commented Jun 4, 2024

Describe the task

Add a flag to the forms that check if validation has been perfomed (and passed)
Deny sending shift/inspection records if validation has not been performed

Purpose

Users can bypass inspection validation if they close the application and re-open it. This could be done intentionally or unintentionally from a user:

  • Closing the app for a period of time so the app closed
  • The app crashing
  • The user force closing the application and re-opening it
  • Probably other similar reasons

If the user was currently in an incomplete form when this occurred there is no measure in place to prevent uploading of the bad form (Users may not even be aware they had an incomplete inspection)

Acceptance Criteria

  • Boolean flag added to forms to ensure form has been validated Occurs When validation is checked on exit, defaults false
  • When inspections are submitted to API, there is a pre-check that all forms have flag == true before being sent out
  • Display some level of error message so user can identify there are incomplete shifts/inspections
  • Create new Status 'Contains Error' or something similar
    • Error sets circle icon to red

Additional context

This ticket is based on theory of what could be done given application limitations (and keeping in mind there is a redesign planned for the apps future where this specific issue is handled much more gracefully)

  • There are certain limitations with the current application in how it was designed
    • Validation is set in a View controller for the form, so it isn't hoisted elsewhere
    • Even with this specific change in form validation, a user could in theory have a validated form, go back, change something, and bypass the in-form validation leaving it marked as validation.
    • This is oddly specific and would require a user have an already validated form then break it
      • 90% of validation is ensuring that the user toggled a boolean, which is impossible to undo
      • Validation only occurs when a user tries to exit the form through the back or submit buttons
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant