Skip to content

com.braintreepayments.api.ThreeDSecureActivity instance is Leaking #898

@AnastasiyaVia

Description

@AnastasiyaVia

Braintree SDK Version

4.39.0

Environment

Both

Android Version & Device

all devices & versions

Braintree dependencies

def brainTreeVersion = '4.39.0'

implementation "com.braintreepayments.api:card:$brainTreeVersion"
implementation "com.braintreepayments.api:google-pay:$brainTreeVersion"
implementation "com.braintreepayments.api:paypal:$brainTreeVersion"
implementation "com.braintreepayments.api:local-payment:$brainTreeVersion"
implementation "com.braintreepayments.api:data-collector:$brainTreeVersion"
implementation "com.braintreepayments.api:paypal-data-collector:$brainTreeVersion"
implementation("com.braintreepayments.api:three-d-secure:$brainTreeVersion") {
    exclude group: 'org.bouncycastle'
}
implementation 'com.braintreepayments.api:drop-in:6.13.0'
implementation 'com.braintreepayments:encryption:2.1.0'
implementation 'com.braintreepayments:popup-bridge:3.2.0'

Describe the bug

I've encountered an issue while 3DS payments with BraintreeSDK. During the payment process, specifically when adding payment information or attempting to complete a transaction with 3DS security enabled, we're experiencing a leak detection within the SDK.

Any guidance or steps you could share to address this leak would be greatly appreciated.

Thank you for your prompt attention to this urgent issue.

Please see the leak below:
┬─── │ GC Root: Thread object │ ├─ android.net.ConnectivityThread instance │ Leaking: NO (PathClassLoader↓ is not leaking) │ Thread name: 'ConnectivityThread' │ ↓ Thread.contextClassLoader ├─ dalvik.system.PathClassLoader instance │ Leaking: NO (init↓ is not leaking and A ClassLoader is never leaking) │ ↓ ClassLoader.runtimeInternalObjects ├─ java.lang.Object[] array │ Leaking: NO (init↓ is not leaking) │ ↓ Object[11001] ├─ com.cardinalcommerce.a.init class │ Leaking: NO (a class is never leaking) │ ↓ static init.cca_continue │ ~~~~~~~~~~~~ ├─ com.cardinalcommerce.a.CardinalError instance │ Leaking: UNKNOWN │ Retaining 95.2 kB in 284 objects │ ↓ CardinalError.cca_continue │ ~~~~~~~~~~~~ ├─ com.cardinalcommerce.cardinalmobilesdk.models.CardinalChallengeObserver instance │ Leaking: UNKNOWN │ Retaining 143.0 kB in 2214 objects │ ↓ init.getSDKVersion │ ~~~~~~~~~~~~~ ├─ com.cardinalcommerce.shared.userinterfaces.ProgressDialog instance │ Leaking: UNKNOWN │ Retaining 41.8 kB in 843 objects │ configure instance of com.braintreepayments.api.ThreeDSecureActivity with mDestroyed = true │ ↓ ProgressDialog.configure │ ~~~~~~~~~ ╰→ com.braintreepayments.api.ThreeDSecureActivity instance ​ Leaking: YES (ObjectWatcher was watching this because com.braintreepayments.api.ThreeDSecureActivity received ​ Activity#onDestroy() callback and Activity#mDestroyed is true) ​ Retaining 8.1 kB in 263 objects ​ key = 86017ee6-7b58-4081-a181-38cf2cbd85f8 ​ watchDurationMillis = 45169 ​ retainedDurationMillis = 40168 ​ mApplication instance of via.rider.ViaRiderDebugApplication ​ mBase instance of androidx.appcompat.view.ContextThemeWrapper
an

To reproduce

  1. add credit card
  2. pay with credit card including 3ds challenge
  3. every time just after we close 3ds screen - the leak from the leak canary is detected

Expected behavior

No leak should be on this scenario

Screenshots

Screenshot 2024-01-28 at 16 22 07

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions