2.0 KiB
2.0 KiB
id, title, status, assignee, created_date, labels, dependencies, references, modified_files, parent_task_id, priority, ordinal
| id | title | status | assignee | created_date | labels | dependencies | references | modified_files | parent_task_id | priority | ordinal | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ML-169.9 | Fix: Full stream resets on pagination within same search | To Do | 2026-05-19 11:48 |
|
|
|
ML-169 | medium | 30000 |
Description
Optimize stream behavior so that pagination within the same search does not trigger a full stream(..., reset: true). Search and order changes still legitimately need resets.
Problem
Every search query change, order toggle, or pagination click triggers a full stream(..., reset: true). While reset: true is correct when the entire dataset changes (new search query), it's unnecessary for pagination within the same search — the existing items don't change, only new ones are appended.
Files
lib/music_library_web/live_helpers/index_actions.ex:89—load_and_assign_recordsusesreset: truelib/music_library_web/live/scrobbled_tracks_live/index.ex:334—load_and_assign_tracksusesreset: truelib/music_library_web/live/artist_live/show.ex:698-699—assign_recordsusesreset: true
Fix
Use stream(..., at: -1) (append) for "load more" pagination. Only use reset: true when search text or order field changes. This requires distinguishing between a "new search" and "same search, next page" in the pagination handler.
Acceptance Criteria
- #1 Pagination to next page appends records without full stream reset
- #2 Existing stream items remain visible during pagination
- #3 Search query change still triggers full stream reset
- #4 Order change still triggers full stream reset
- #5 No duplicate records appear after multiple pagination clicks