MetaMask / metamask-mobile

Mobile web browser providing access to websites that use the Ethereum blockchain
https://metamask.io
Other
2.08k stars 1.08k forks source link

[Bug]: Crash app at https://www.yodobashi.com/ #9018

Open lydhvmo opened 4 months ago

lydhvmo commented 4 months ago

Describe the bug

Clicking on the search section on https://www.yodobashi.com/ caused the app to crash on Android

Expected behavior

no crashes

Screenshots/Recordings

image

Steps to reproduce

Go to 'yodobashi' Click on search at home screen

Error messages or log output

No response

Version

7.17.1

Build type

None

Device

All smart phone samsung, pixel, moto

Operating system

Android, Android 13

Additional context

After a bug occurred, the app could no longer be used even if I cleared the app's cache Root cause: https://github.com/square/okhttp/issues/6897 decodeHeaderAsJavaNetCookies(JavaNetCookieJar.kt:98)

Severity

No response

nghia-tran-alobridge commented 4 months ago

Detail: OKHTTP_VERSION (react-native v0.71.15) : https://github.com/facebook/react-native/blob/5761ad6437b29dc559fce0914f2a8e71d02d25b3/ReactAndroid/gradle.properties#L17

gauthierpetetin commented 4 months ago

Hi @lydhvmo , thanks for reporting this issue. How did you manage to identify https://github.com/square/okhttp/issues/6897 as the root cause?

nghia-tran-alobridge commented 4 months ago

Hi @gauthierpetetin. We,@lydhvmo and I, built the Metamask app and found this message in the Android Studio - Logcat

Screenshot 2024-03-25 at 13 55 40
E  FATAL EXCEPTION: OkHttp Dispatcher
    Process: io.metamask.flask, PID: 23779
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
        at java.lang.String.substring(String.java:1975)
        at okhttp3.JavaNetCookieJar.decodeHeaderAsJavaNetCookies(JavaNetCookieJar.kt:98)
        at okhttp3.JavaNetCookieJar.loadForRequest(JavaNetCookieJar.kt:59)
        at com.facebook.react.modules.network.ReactCookieJarContainer.loadForRequest(ReactCookieJarContainer.java:44)
        at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:74)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
        at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:517)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
        at java.lang.Thread.run(Thread.java:764)

https://github.com/square/okhttp/blob/parent-4.9.2/okhttp-urlconnection/src/main/kotlin/okhttp3/JavaNetCookieJar.kt#L98

NicolasMassart commented 4 months ago

This is very probably due to the favicon code crashing when trying to fetch this page. aside from the fact that the fetch to this page fails, the favicon code should not crash. It should properly just log and fallback to default icon. This is a bug for @MetaMask/mobile-platform team and as I worked on this code already, I can be assigned to it.

NicolasMassart commented 3 months ago

Just comment that this doesn't happen on iOS

github-actions[bot] commented 3 weeks ago

This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 7 days. Thank you for your contributions.