[PR #22859] [CLOSED] fix: prevent URL double-indexing on # trigger after backspace #65748

Closed
opened 2026-05-06 11:40:44 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/22859
Author: @gambletan
Created: 3/19/2026
Status: Closed

Base: mainHead: fix/duplicate-url-indexing-22749


📝 Commits (1)

  • a09bee4 fix: remove duplicate keydown listener causing URL double-indexing on # trigger

📊 Changes

1 file changed (+0 additions, -13 deletions)

View changed files

📝 src/lib/components/chat/MessageInput/Commands/Knowledge.svelte (+0 -13)

📄 Description

Summary

Fixes #22749

  • Removed a redundant global window.addEventListener('keydown', ...) in the Knowledge.svelte command component that duplicated the Enter key handling already provided by CommandSuggestionList's _onKeyDown method (called by TipTap's suggestion renderer plugin)
  • When typing #, backspacing to remove it, then typing # again and selecting a URL, the select() function fired twice — once through TipTap's suggestion plugin key handler and once through the redundant global listener — causing the URL to be indexed twice
  • The fix removes the duplicate listener, relying solely on the suggestion renderer's existing key event pipeline

Test plan

  • Type # in the chat input, then press Backspace to remove it
  • Type # again and enter/select a URL
  • Verify the URL is indexed only once (not duplicated in the files list)
  • Verify that Enter/Tab key selection still works correctly in the # knowledge suggestion dropdown
  • Verify that @, /, and $ trigger suggestions are unaffected

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/22859 **Author:** [@gambletan](https://github.com/gambletan) **Created:** 3/19/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/duplicate-url-indexing-22749` --- ### 📝 Commits (1) - [`a09bee4`](https://github.com/open-webui/open-webui/commit/a09bee40049dc3cd2a2e99cc144533628e59c136) fix: remove duplicate keydown listener causing URL double-indexing on # trigger ### 📊 Changes **1 file changed** (+0 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/components/chat/MessageInput/Commands/Knowledge.svelte` (+0 -13) </details> ### 📄 Description ## Summary Fixes #22749 - Removed a redundant global `window.addEventListener('keydown', ...)` in the `Knowledge.svelte` command component that duplicated the Enter key handling already provided by `CommandSuggestionList`'s `_onKeyDown` method (called by TipTap's suggestion renderer plugin) - When typing `#`, backspacing to remove it, then typing `#` again and selecting a URL, the `select()` function fired twice — once through TipTap's suggestion plugin key handler and once through the redundant global listener — causing the URL to be indexed twice - The fix removes the duplicate listener, relying solely on the suggestion renderer's existing key event pipeline ## Test plan - [ ] Type `#` in the chat input, then press Backspace to remove it - [ ] Type `#` again and enter/select a URL - [ ] Verify the URL is indexed only once (not duplicated in the files list) - [ ] Verify that Enter/Tab key selection still works correctly in the `#` knowledge suggestion dropdown - [ ] Verify that `@`, `/`, and `$` trigger suggestions are unaffected 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-06 11:40:44 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#65748