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

Infinite loop on small screen device when STPPaymentCardTextField.cvcPlaceholder is long #1731

Closed
rocketnik opened this issue Dec 13, 2020 · 4 comments
Assignees
Labels
triaged Issue has been reviewed by Stripe and is being tracked internally

Comments

@rocketnik
Copy link

rocketnik commented Dec 13, 2020

Tested on
Device iPhone SE 1st Gen, iOS 13.5.1
Simulator iPhone SE 1st Gen, iOS 13.4

It is possible to create an infinite loop on the main thread resulting in app not responding.

Steps to reproduce:

  • create an STPPaymentCardTextField (e.g. via interface builder)
  • make the leading/trailing distance to the screen 15pt each
  • set the STPPaymentCardTextField.cvcPlaceholder to something long (e.g. "Kreditkartenprüfnummer")
  • Run the app
  • Enter 4242 4242 4242 4242 424 242

The app will go into an infinite loop.
It does not happen, if the cvcPlaceholder is set to "CVC" - maybe it could happen, if the STPPaymentCardTextField was smaller.

Installation method

cocoapods

SDK version

21.1.0

@rocketnik
Copy link
Author

rocketnik commented Dec 13, 2020

App hanging

IMG_0009

@rocketnik
Copy link
Author

Instruments showing a lot of cpu cycles

Screen Shot 2020-12-12 at 22 40 47

Screen Shot 2020-12-12 at 22 40 57

@yuki-stripe yuki-stripe self-assigned this Dec 16, 2020
@yuki-stripe
Copy link
Collaborator

Hi @rocketnik,

Thanks for the thorough report - looks like this was introduced in v21.0.0. I have a fix that will be in the next release

@yuki-stripe yuki-stripe added the triaged Issue has been reviewed by Stripe and is being tracked internally label Dec 16, 2020
@davidme-stripe
Copy link
Contributor

Sorry for the delay! This should be fixed in version 21.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged Issue has been reviewed by Stripe and is being tracked internally
Projects
None yet
Development

No branches or pull requests

3 participants