android / android/architecture-samples

[todo-mvvm-live-kotlin] Espresso idle counter gets corrupted

Open
#657 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
45.8k
Forks
11.9k
PR merge metrics
No merged PRs in 30d

Description

In todo-mvvm-live-kotlin in Util/ViewExt.kt, in the callback of the showSnackbar function there gets the EspressoIdlingResource incremented and decremented.
The problem is, that if onDismissed is called before onShown, the counter gets corrupted.
This case may happen if showSnackbar is called two times in a really short period of time.

Contributor guide

Open the contributing guide

Research direction

Start in todo-mvvm-live-kotlin/Util/ViewExt.kt at the showSnackbar callback and trace how EspressoIdlingResource is incremented and decremented. Reproduce two rapid showSnackbar calls, including onDismissed before onShown, and verify that the idle counter remains balanced in both callback orders.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.