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

fix: failed ensures should block submission #6654

Merged
merged 2 commits into from
Aug 24, 2023
Merged

Conversation

LinHuiqing
Copy link
Contributor

@LinHuiqing LinHuiqing commented Aug 24, 2023

Problem

Bug was introduced by #6595 where failing ensures do not return early if a response has already been sent.

Solution

Breaking Changes

  • No - this PR is backwards compatible

Bug Fixes:

  • Failing ensures should return early.

Tests

Check that storage mode submissions will be gated by ensures.

  • ensureIsPublicForm:
    • Go to a public form.
    • Close the form on the admin portal.
    • Make a submission. Submission should not succeed.
      • Error should be shown to client.
      • New submission should not show up on DB
  • ensureValidCaptcha:
    • Go to a public form with captcha disabled.
    • Enable captcha on the admin portal.
    • Make a submission. Submission should not succeed.
      • Error should be shown to client.
      • New submission should not show up on DB
  • ensureFormWithinSubmissionLimits:
    • Go to a public form with a submission limit. The form should still be open at this point.
    • On the DB, edit the submission limit so that it is less than or equal to the number of existing submissions.
    • Make a submission. Submission should not succeed.
      • Error should be shown to client.
      • New submission should not show up on DB

@LinHuiqing LinHuiqing marked this pull request as ready for review August 24, 2023 04:00
Copy link
Contributor

@tshuli tshuli left a comment

Choose a reason for hiding this comment

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

lgtm

@LinHuiqing LinHuiqing merged commit c497f90 into develop Aug 24, 2023
24 checks passed
@LinHuiqing LinHuiqing deleted the fix/ensures-to-block branch August 24, 2023 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants