mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 11:28:35 -05:00
[GH-ISSUE #4428] bug: duplicate tags #29133
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ProjectMoon on GitHub (Aug 7, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/4428
Bug Report
Installation Method
Docker
Environment
Confirmation:
Expected Behavior:
When adding a tag to a chat, if that tag already exists, there's a large chance that it will be duplicated both in the sidebar tag list, and in the list of tags on the chat itself.
Actual Behavior:
One tag = one tag. Do not display duplicates of the same tags.
Description
Bug Summary:
When using a tag that already exists, the UI will duplicate it. However, there seems to only be a single tag stored on the chat in the backend.
Reproduction Details
Steps to Reproduce:
Tag multiple chats with the same tag. I think there might be some more factors at play here, because sometimes the duplication is 2x, or 3x, or even 4x. It doesn't necessarily seem related to the number of chats with the same tag.
Logs and Screenshots
Screenshots/Screen Recordings (if applicable):


@tjbck commented on GitHub (Aug 7, 2024):
I'm unable to reproduce this issue, if someone could describe a step by step method to reproduce I'd greatly appreciate it!
@ProjectMoon commented on GitHub (Aug 7, 2024):
Here is a bit more info:

It looks like my assumption about the backend was wrong; these tags are returned with different IDs.
I wonder if this is related to a DB migration that happened at some point along the way. This only started showing up after one of the recent releases (unsure of which one, exactly). They show up as duplicates in the database too.
So it seems like duplicate tags in DB + UI that expects unique tag names = this problem.
@ProjectMoon commented on GitHub (Aug 7, 2024):
Also, I've got a
tagtable and achatidtagtable. Which one is used? Are both used? o_O@ProjectMoon commented on GitHub (Aug 7, 2024):
I was able to "fix" this by deleting all but one of the duplicated tags. The duplicated tags can be found by a query like this (sqlite):
This does not, however, help reproduce it. My money is still on a DB migration.
@tjbck commented on GitHub (Oct 15, 2024):
Should be addressed with
cf24a65caain dev.@AndroidHemroid commented on GitHub (Oct 26, 2024):
This still seems to be an issue with the latest 3.33 Duplicate chats start popping up in the sidebar. It seems to be triggered by using the search adding a couple words in it then just backspace over the last word entered. The sidebar pulls in what is searched. And once you clear out the search field, duplicates seem to be in the sidebar of some of the chats. It seems like DB index for the chat history or sidebar values are getting pulled in and contaminating the actually master index.
A possible future fix would be to add two new fields to the DB where chats would have a date & time stamp as well as a Unique sequential record number. Then add a DB integrity verifier that would create an integrity index DB sorted by date of chat as well as record# then build a new cleanup Index DB that would filter out the duplicates. Also, it may be the bulk export or import of chats stage contaminating also. But seems to show up just after using the search more so just after the bulk import of chats which seems to leave out some of the backed up chats and pop up just after using the search but with duplicates.
I am going to go see if it repeats the problem on 3.34 which just come out today.
@tjbck commented on GitHub (Oct 26, 2024):
@AndroidHemroid would appreciate your help here, PR welcome!