android / android/codelab-android-paging

The pagingSourceFactory from DB can lead wrong data display

Open
#202 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
509
Forks
268
PR merge metrics
No merged PRs in 30d

Description

In case you search for a key word then re-type and search again with another word included in your result list.
The LIKE query will bring that result to top of screen because it still in your DB. and it can show up in UI before new data come in.

// appending '%' so we can allow other characters to be before and after the query string
val dbQuery = "%${query.replace(' ', '%')}%"
val pagingSourceFactory = { database.reposDao().reposByName(dbQuery)}

Contributor guide

Open the contributing guide

Research direction

The relevant entry points shown are pagingSourceFactory and database.reposDao().reposByName(dbQuery). Read how the Paging source is recreated during a new search, then reproduce two searches where an old database match is present. Done means the previous query’s local match does not appear ahead of the new results.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.