Skip to content
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

3.0.0-beta1 always shows "0" in notification #84

Closed
ColtonIdle opened this issue Aug 9, 2019 · 10 comments · Fixed by #87
Closed

3.0.0-beta1 always shows "0" in notification #84

ColtonIdle opened this issue Aug 9, 2019 · 10 comments · Fixed by #87
Assignees
Labels
bug Something isn't working

Comments

@ColtonIdle
Copy link

The beta shows

"AppName • 0 • Now"

vs the stable showing

"AppName • 1 • Now"

Looks like the count isn't incrementing in the beta vs stable.

@cortinico
Copy link
Member

@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?

@cortinico cortinico added the incomplete This issue needs more data in order to be triaged label Aug 9, 2019
@ColtonIdle
Copy link
Author

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.

@cortinico
Copy link
Member

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

@ColtonIdle
Copy link
Author

ColtonIdle commented Aug 9, 2019

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

@cortinico
Copy link
Member

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

@ColtonIdle
Copy link
Author

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.

@cortinico
Copy link
Member

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

@ColtonIdle
Copy link
Author

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

@ColtonIdle
Copy link
Author

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.

@cortinico cortinico added bug Something isn't working and removed incomplete This issue needs more data in order to be triaged labels Aug 10, 2019
@cortinico cortinico self-assigned this Aug 10, 2019
@cortinico
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants