Skip to content

Comments

fix(chat): prevent duplicate prompt suggestions causing UI freeze#18849

Closed
fsmw wants to merge 1 commit intoopen-webui:mainfrom
fsmw:fix/18566-duplicate-prompt-suggestions-freeze
Closed

fix(chat): prevent duplicate prompt suggestions causing UI freeze#18849
fsmw wants to merge 1 commit intoopen-webui:mainfrom
fsmw:fix/18566-duplicate-prompt-suggestions-freeze

Conversation

@fsmw
Copy link

@fsmw fsmw commented Nov 1, 2025

Summary

Add reactive deduplication logic to prevent duplicate prompt suggestions from causing UI freeze in Svelte each block.

Issue

Fixes #18566 - Duplicate prompt suggestions freezes webpage and throws JS error (2 bugs!)

Changes Made

  • Added reactive deduplication using Map for filteredPrompts
  • Ensured unique keys in Svelte each block
  • Prevented "Cannot have duplicate keys" error
  • Maintained existing prompt filtering functionality

Testing

  • Reproduced duplicate prompt suggestions freeze
  • Verified fix prevents UI freeze
  • Tested with multiple duplicate prompts
  • Confirmed no console errors after fix

Additional Information

This fix addresses the root cause of browser freezing when duplicate prompt content exists by ensuring unique keys in the Svelte each block.

I agree to the terms of the Contributor License Agreement (CLA) and grant the necessary rights for my contributions to be included in this open-source project.

💘 Generated with Crush

Add deduplication logic for prompt suggestions to prevent Svelte from
throwing "Cannot have duplicate keys in a keyed each" error when duplicate
prompt content exists.

- Uses reactive $: statement to create uniquePrompts array
- Deduplicates based on prompt.id or prompt.content (preserves existing logic)
- Updates each block to use deduplicated prompts
- Maintains all existing functionality while preventing freeze

Fixes open-webui#18566

💘 Generated with Crush
@owui-terminator
Copy link

👋 Thanks for the PR @fsmw!

This repository requires the following CLA text in the PR description:

contributor license agreement

I couldn’t find it, so I’m closing this PR automatically.

Please update your PR body and reopen. I'll be back if you don't! 🤖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

issue: Duplicate prompt suggestions freezes webpage and throws JS error (2 bugs!)

1 participant