-
Notifications
You must be signed in to change notification settings - Fork 120
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 crash: duplicate items when rendering payment methods list #1840
Fix crash: duplicate items when rendering payment methods list #1840
Conversation
2a2a3d7
✅ No changes detectedComparing Analyzed targets: Adyen, AdyenActions, AdyenCard, AdyenCashAppPay, AdyenComponents, AdyenDelegatedAuthentication, AdyenDropIn, AdyenEncryption, AdyenSession, AdyenSwiftUI, AdyenTwint, AdyenWeChatPay |
Quality Gate passedIssues Measures |
Summary
iOS18 release introduced new crash which didn't happen before.
When rendering payments list, in rare occasions we could have multiple payment methods having same title and description.
Providing ListItem that is used to render the list uses title as part of it's
Hashable
andEquatable
conformance, resulting in having two identical entries.This list typically has few sections: stored payment methods and generic payment methods. While any stored payment method always has an unique identifier coming from the backend, the rest of the sections do not.
That's why this fix does not use any backend-provided identifiers and relies purely on
UUID
that is created uponListItem
instantiation and doesn't get exposed anywhere else.It can be improved by providing a parameter in the init so it could be injected from the outside.
Note:
ListItem
hasidentifier
property that can be mistreated easily and abused. We use it so set an identifier that is later used asaccessibilityIdentifier
for UI elements. This is misleading as for such a case when we have two identical stored payment methods this could be a potential accessibility problem that will make second duped element on the list inaccessible.Screenshot
COIOS-797