Mobile app development / DIJION
Growing mobile lists: duplicates, missing items and lost position
A pagination plan separating initial load, next-page load and refresh while addressing changing order and scroll position.
Loading more records at the bottom of a list looks simple. Insertions, duplicate records across pages and failed follow-up requests make it less predictable. In an illustrative notes archive, a reader should be able to return to a recently inspected article. Refreshing should not unexpectedly discard their position or make the list appear to lose items.
Define identity before ordering
Do not identify records solely by their visible positions. Stable identifiers help distinguish duplicates and restore the right card. Document the server’s ordering and page-boundary contract. Using a cursor alone does not guarantee a consistent snapshot; the behavior of a changing dataset still needs an explicit backend agreement.
Separate three loading operations
Scroll the table horizontally to see all columns.
| Operation | Visible content | Failure behavior |
|---|---|---|
| Initial page | No records available yet | Offer full-view recovery |
| Next page | Keep existing records | Retry at the list end |
| Refresh | Identify the current list | Retain old data transparently |
Keep old requests out of a new filter
A previous page response may still be in flight when filters change. Evaluate the response together with its query context so records from the old category cannot enter the new list. Define how overlapping loads are accepted. Android Paging supports paged data, error handling and retries; the team still owns the product’s empty-state and position decisions.
Restore position using item context
A saved pixel offset may point elsewhere after card heights change. Consider restoring the selected record and nearby context. If that record disappeared, choose a sensible neighbor and limit unexpected movement. When infinite scrolling makes the footer difficult to reach, an explicit Load more action or numbered pagination may be a better fit.
Test at page boundaries
- Change filters while the second page is loading.
- Insert, remove and repeat an identifier across pages.
- Fail a subsequent load; existing cards should remain.
- Return from details with a removed card and enlarged text.
Acceptance should go beyond more cards appearing. Identity, ordering, recovery and position behavior must work together for a list to remain understandable in everyday use.