Skip to content

fix: stripe crash on Android #815

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

Merged
merged 2 commits into from
Feb 19, 2025
Merged

fix: stripe crash on Android #815

merged 2 commits into from
Feb 19, 2025

Conversation

kirillzyusko
Copy link
Owner

@kirillzyusko kirillzyusko commented Feb 18, 2025

📜 Description

Fixes a crash after entering date expiry in stripe input on Android.

💡 Motivation and Context

Closes #807 stripe/stripe-android#10178

The detailed explanation of the problem can be found here: stripe/stripe-android#10178 (comment)

We decided that both frameworks (stripe and keyboard-controller) should implement a fix, so I'm adding asynchronous removal in this PR. Screenshots proving that it works as expected:

When we call remove:

image

Async (holds the same references):

image

📢 Changelog

Android

  • remove text watcher asynchronously (via .post) with capturing TextWatcher into a closure (to remove correct watcher);

🤔 How Has This Been Tested?

Tested manually in example app (with added Stripe SDK).

📸 Screenshots (if appropriate):

Screen.Recording.2025-02-19.at.19.18.26.mov

📝 Checklist

  • CI successfully passed
  • I added new mocks and corresponding unit-tests if library API was changed

@kirillzyusko kirillzyusko added 🤖 android Android specific 🎯 crash Library triggers a crash of the app labels Feb 18, 2025
@kirillzyusko kirillzyusko self-assigned this Feb 18, 2025
Copy link
Contributor

github-actions bot commented Feb 18, 2025

📊 Package size report

Current size Target Size Difference
167643 bytes 167566 bytes 77 bytes 📈

@kirillzyusko kirillzyusko marked this pull request as ready for review February 19, 2025 18:37
@kirillzyusko kirillzyusko merged commit 80d8662 into main Feb 19, 2025
16 checks passed
@kirillzyusko kirillzyusko deleted the fix/stripe-crash branch February 19, 2025 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 android Android specific 🎯 crash Library triggers a crash of the app
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v1.16.x causes Android crash with stripe-react-native CardField component
1 participant