Coder Social home page Coder Social logo

Comments (10)

cortinico avatar cortinico commented on May 22, 2024 1

Thanks for the code @ColtonIdle
I was able to reproduce and here the potential fix: #87

from chucker.

cortinico avatar cortinico commented on May 22, 2024

@ColtonIdle I'm not sure I completely got your point, but apparently it works fine (latest master):
photo5940438674225344623

Can you provide more insights or a project that I can checkout and test?

from chucker.

ColtonIdle avatar ColtonIdle commented on May 22, 2024

Looks like it's working for you. I don't think master has a release artifact available right?

What happens if you try with latest beta. Feel free to close for now if you want. I'll try the latest master when it's released.

from chucker.

cortinico avatar cortinico commented on May 22, 2024

I don't think master has a release artifact available right?

There is no master branch 😅
You can anyway try the latest SNAPSHOT from the develop branch with:

dependencies {
  debugImplementation 'com.github.ChuckerTeam.Chucker:library:develop-SNAPSHOT'
  releaseImplementation 'com.github.ChuckerTeam.Chucker:library-no-op:develop-SNAPSHOT'
}

Feel free to close for now if you want

I'm closing now but feel free to re-open if you manage to reproduce

from chucker.

ColtonIdle avatar ColtonIdle commented on May 22, 2024

Oh. I thought there was a master branch because you said

I'm not sure I completely got your point, but apparently it works fine (latest master)

I just tried this again, (using SNAPSHOT) and it's still showing 0. Maybe it's because on the Q Beta 6?

I'll try on my api 28 emulator...

Nope. Shows 0 on the emulator. Looks like it's a valid bug?

Screen Shot 2019-08-09 at 4 45 11 PM

from chucker.

cortinico avatar cortinico commented on May 22, 2024

Do you have other Interceptors?
Are you using any other proxy that might rewrite your requests (like Charles or similar)?

from chucker.

ColtonIdle avatar ColtonIdle commented on May 22, 2024

I have a few things going on at the same time, like Flipper, etc. Let me remove them.

Just as a heads up though. If I migrate back down to the current stable, then the numbers show fine.

from chucker.

cortinico avatar cortinico commented on May 22, 2024

I have a few things going on at the same time, like Flipper, etc. Let me remove them.

The best would be to have like a project that I can checkout where the issue is reproducible

from chucker.

ColtonIdle avatar ColtonIdle commented on May 22, 2024

Removed flipper, stetho, etc. Same issue.

Tried downgrading again to make sure I wasn't going crazy. Sure enough, it works.

Screen Shot 2019-08-09 at 5 07 43 PM

from chucker.

ColtonIdle avatar ColtonIdle commented on May 22, 2024

My project:

class MainActivity : AppCompatActivity() {

    lateinit var client: OkHttpClient
    lateinit var retrofit: Retrofit
    lateinit var service: MyService

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        client = OkHttpClient.Builder()
            .addInterceptor(ChuckInterceptor(this))
            .build()

        retrofit = Retrofit.Builder()
            .baseUrl("http://www.mocky.io/v2/")
            .client(client)
            .addConverterFactory(MoshiConverterFactory.create())
            .build()

        service = retrofit.create(MyService::class.java)
        button1.setOnClickListener { button1Clicked() }
    }

    fun button1Clicked() {
        val call = service.getPersonValid()
        call.enqueue(object : Callback<Person> {
            override fun onFailure(call: Call<Person>, t: Throwable) {
                Toast.makeText(this@MainActivity, "Fail", Toast.LENGTH_LONG).show()
            }
            override fun onResponse(call: Call<Person>, response: Response<Person>) {
                Toast.makeText(this@MainActivity, "Success", Toast.LENGTH_LONG).show()
            }
        })
    }
}
    interface MyService {
        @GET("5d4d9ebf3300003e3a33792e?mocky-delay=1000ms")
        fun getPersonValid(): Call<Person>
}
data class Person(
    val person: String = ""
)

If I use stable, the above works. If I change to SNAPSHOT (and also change ChuckInterceptor to ChuckerInterceptor) then it does not work.

from chucker.

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.