Giter Site home page Giter Site logo

Comments (14)

jakubuid avatar jakubuid commented on September 15, 2024 1

@rafaelekol thank you! We'll look into this ASAP

from walletconnectkotlinv2.

TalhaAli00 avatar TalhaAli00 commented on September 15, 2024 1

@rafaelekol we're still investigating a solution to enable failover for both our Http client and websocket client

from walletconnectkotlinv2.

rafaelekol avatar rafaelekol commented on September 15, 2024

Function coreAndroidNetworkModule() in CoreNetworkModule.kt file contains multiple calls chain.proceed() which can cause such error.
I couldn't reproduce this error with your sample app.

from walletconnectkotlinv2.

abdrasulov avatar abdrasulov commented on September 15, 2024

It may be the same issue as described here

https://stackoverflow.com/questions/76287902/java-lang-illegalstateexception-cannot-make-a-new-request-because-the-previous

from walletconnectkotlinv2.

jakubuid avatar jakubuid commented on September 15, 2024

The newest version is 1.21.0. Can you upgrade and see if this still persists?

from walletconnectkotlinv2.

rafaelekol avatar rafaelekol commented on September 15, 2024

@jakubuid I tried to update until version 1.21.0.
But it didn't help. I am getting same error.

from walletconnectkotlinv2.

jakubuid avatar jakubuid commented on September 15, 2024

Can you provide reproduction steps?

from walletconnectkotlinv2.

rafaelekol avatar rafaelekol commented on September 15, 2024

@jakubuid
Inside this class com.walletconnect.android.internal.common.di.CoreNetworkModule I added 2 lines of code to reproduce
crash that is happening in our project.

@Suppress("LocalVariableName")
@JvmSynthetic
fun coreAndroidNetworkModule(serverUrl: String, connectionType: ConnectionType, sdkVersion: String, timeout: NetworkClientTimeout? = null) = module {
    val DEFAULT_BACKOFF_SECONDS = 5L
   ...

single(named(AndroidCommonDITags.FAIL_OVER_INTERCEPTOR)) {
        Interceptor { chain ->
            val request = chain.request()
            try {
                val host = request.url.host

               //I added these 2 lines
                chain.proceed(request)
                throw SocketException("test")

                when {
                    shouldFallbackRelay(host) -> chain.proceed(request.newBuilder().url(get<String>(named(AndroidCommonDITags.RELAY_URL))).build())
                    shouldFallbackPush(host) -> chain.proceed(request.newBuilder().url(getFallbackPushUrl(request.url.toString())).build())
                    shouldFallbackVerify(host) -> chain.proceed(request.newBuilder().url(getFallbackVerifyUrl(request.url.toString())).build())
                    else -> chain.proceed(request)
                }
            } catch (e: Exception) {
                if (isFailOverException(e)) {
                    when (request.url.host) {
                        DEFAULT_RELAY_URL.host -> fallbackRelay(request, chain)
                        DEFAULT_PUSH_URL.host -> fallbackPush(request, chain)
                        DEFAULT_VERIFY_URL.host -> fallbackVerify(request, chain)
                        else -> chain.proceed(request)
                    }
                } else {
                    chain.proceed(request)
                }
            }
        }
    }

...

from walletconnectkotlinv2.

rafaelekol avatar rafaelekol commented on September 15, 2024

Hi, any updates on this issue?

from walletconnectkotlinv2.

TalhaAli00 avatar TalhaAli00 commented on September 15, 2024

@rafaelekol are you able to tell us if you saw this issue in a Debug build or on a Release build?

from walletconnectkotlinv2.

rafaelekol avatar rafaelekol commented on September 15, 2024

@TalhaAli00 This crash is steadily happens when I try to increase your Release library higher than 1.15.0.
We suspect that issue lies in combination of other network libraries that we use in our App with your SDK.

from walletconnectkotlinv2.

rafaelekol avatar rafaelekol commented on September 15, 2024

@TalhaAli00 Any progress on this bug?
This issue is holding us from updating your SDK in our wallet.

from walletconnectkotlinv2.

TalhaAli00 avatar TalhaAli00 commented on September 15, 2024

Hello @rafaelekol
We've been able to focus time to resolving this issue. There's a PR #1365 where I've able to make sure that the interceptor isn't leaving a response open when switching over during the failover logic. We'll be releasing a new version this week with this fix

from walletconnectkotlinv2.

rafaelekol avatar rafaelekol commented on September 15, 2024

@TalhaAli00 thats great news 👍🏼

from walletconnectkotlinv2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.