-
Notifications
You must be signed in to change notification settings - Fork 263
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
CardField crash the app with EXC_BAD_ACCESS on iOS 13.* #391
Comments
We start to receive similar crash reports from the production app. I'm not 100% confident that this is coming from
|
Removing override func removeFromSuperview() {
self.delegate?.onDidDestroyViewInstance(id: CARD_FIELD_INSTANCE_ID)
} |
We've created example app https://github.com/aganov/stripe-rn-ca-mask-crash containing just Kapture.2021-07-13.at.09.10.38.mp4 |
Ok getting rid of strange // CardFieldManager.swift
@objc(CardFieldManager)
class CardFieldManager: RCTViewManager {
public func getCardFieldReference(id: String) -> Any? {
return nil
}
override func view() -> UIView! {
return CardFieldView()
}
override class func requiresMainQueueSetup() -> Bool {
return true
}
} Also I've added // CardFieldView.swift
deinit {
print("deinit CardFieldView")
} to But now obviously @thorsten-stripe @arekkubaczkowski Any help on this would be appreciated. I'm thinking of passing public func getCardFieldReference(id: String) -> Any? {
return self.bridge.uiManager.view(forReactTag: ????)
} |
@aganov we are aware of this issue and where it comes from, unfortunately we cannot re-implement it because of PCI compliance. We're in the middle of looking for solution to correct card field deallocation. Thank you for providing such precise dubugging results. |
@arekkubaczkowski Thanks for the update. Just an idea: Since now we have public func getCardFieldReference(node: NSNumber) -> Any? {
// RCTExecuteOnMainQueue?
return self.bridge.uiManager.view(forReactTag: node)
} func createPaymentMethod(params, options) {
let cardFieldView = cardFieldUIManager?.getCardFieldReference(node: options.cardFieldNode) as? CardFieldView
} const cardFieldRef = useRef(null)
<CardField ref={cardFieldRef} />
const result = await createPaymentMethod({ ... }, { cardFieldNode: findNodeHandle(cardFieldRef.current) }) or smth like this. |
@aganov thanks for suggestion but we need an access to the card field params synchronously, RN bridge is async for now (until we don't use turbomodules) |
This will be fixed from the next version (0.1.6) |
Describe the bug
<CardField />
cause a crash if field is not completed when focused previously and got unmounted later on. Happens only on iOS 12To Reproduce
Steps to reproduce the behavior:
<CardField />
componentnavigation.goBack
CardField
againCardField
EXC_BAD_ACCESS
I'm expecting this to crash too if got unmounted and mounted again on the same screen, but have not tried it yet.
Expected behavior
App not crashing
Smartphone (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: