mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-22 21:19:30 -05:00
[PR #22838] [CLOSED] fix: deduplicate notes in pagination to prevent each_key_duplicate error #130542
Reference in New Issue
Block a user
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/22838
Author: @themavik
Created: 3/19/2026
Status: ❌ Closed
Base:
main← Head:fix/22740-notes-duplicate-key-infinite-scroll📝 Commits (1)
473546ffix: deduplicate notes in pagination to prevent each_key_duplicate error📊 Changes
1 file changed (+3 additions, -1 deletions)
View changed files
📝
src/lib/components/notes/Notes.svelte(+3 -1)📄 Description
Summary
Fixes #22740.
Root cause:
getItemsPage()inNotes.svelteappendspageItemstoitemswithitems = [...items, ...pageItems]without deduplication. When the API returns overlapping notes across pages (e.g., due to concurrent note creation shifting pagination offsets), the samenote.idappears at multiple array indices. Svelte's keyed{#each notesList as note, idx (note.id)}then throwseach_key_duplicate, breaking infinite scroll.Fix: Before appending, build a
Setof existing note IDs and filter out any duplicates from the new page.Changes
src/lib/components/notes/Notes.svelte: IngetItemsPage(), deduplicatepageItemsagainst existingitemsbynote.idbefore concatenation.Testing
Made with Cursor
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.