Skip to content

Fix CVV validation error state#1822

Merged
buzzamus merged 1 commit into
card-fields-featurefrom
fix-cvv-field-errors
Jun 18, 2026
Merged

Fix CVV validation error state#1822
buzzamus merged 1 commit into
card-fields-featurefrom
fix-cvv-field-errors

Conversation

@buzzamus

@buzzamus buzzamus commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

  • Fixes an issue where if CVV is entered and card number changes to a card type where CVV length changes, the validation error state wouldn't trigger unless the field was specifically focused again.
  • Fixes an issue where typing in CVV would be laggy in certain situations.
Simulator.Screen.Recording.-.iPhone.17.-.2026-06-18.at.10.25.25.mov

AI Usage

Which AI Agent Was Used?

  • Copilot
  • Claude
  • Other (Type Name Here)

How was AI used?
Track down cause of laggy CVV typing, write unit tests

Estimated AI Code Contribution

  • less than 30%
  • 30 - 60%
  • 60 - 100%

Checklist

  • Added a changelog entry
  • [] Tested and confirmed payment flows affected by this change are functioning as expected

Authors

List GitHub usernames for everyone who contributed to this pull request.

@buzzamus buzzamus requested a review from a team as a code owner June 17, 2026 19:31
@buzzamus buzzamus changed the title fix(uicomponents): Fix CVV validation error state, laggy cvv typing s… Fix CVV validation error state Jun 17, 2026

Publishers.CombineLatest3(cardValid, expValid, cvvValid)
.map { $0 && $1 && $2 }
.removeDuplicates()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

curious why we added this check here 👀

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This ignores duplicates of the same validity, so for example if the form is valid, more typing occurs, and the form is still valid it does not have to re-render the view, which avoids stuttering issues for the CVV masking

@agedd agedd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

would you be able to attach a screen recording of this validation check/fix in effect

}


// MARK: - updateExpectedLength

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice unit tests! 🚀

@buzzamus

Copy link
Copy Markdown
Contributor Author

would you be able to attach a screen recording of this validation check/fix in effect

Updated description with video of the fix!

@jaxdesmarais jaxdesmarais left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for fixing this bug and adding tests for it as well!

@agedd agedd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ty for fixing this! 🚀

@buzzamus buzzamus merged commit c69743a into card-fields-feature Jun 18, 2026
41 of 44 checks passed
@buzzamus buzzamus deleted the fix-cvv-field-errors branch June 18, 2026 18:58
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.

3 participants