Describe the bug
When chat feedback is enabled, clicking the thumbs up / thumbs down button on a bot message does not update the button state. The feedback IS saved correctly (it appears in the Flowise server DB and in localStorage), but the icon only shows the rated state after refreshing the page.
To Reproduce
- Enable Chat Feedback on a chatflow
- Embed the chatbot on a page (tested with flowise-embed 3.1.6 from CDN)
- Send a message, then click 👍 on the bot's reply
- The feedback content dialog opens and the feedback is saved, but the thumb icon does not change to the rated (green/disabled) state
- Refresh the page → the rated state now shows correctly
Expected behavior
The thumb icon should reflect the rating immediately after clicking.
Root cause
BotBubble.tsx already supports reactive rating updates via the messageRatings / onMessageRatingChange props:
- props defined:
|
messageRatings?: Record<string, FeedbackRatingType>; |
|
onMessageRatingChange?: (messageId: string, rating: FeedbackRatingType) => void; |
- read in currentRating():
|
return props.messageRatings?.[messageId] ?? props.message.rating ?? ''; |
- called on click:
|
props.onMessageRatingChange?.(messageId, 'THUMBS_UP'); |
|
props.onMessageRatingChange?.(messageId, 'THUMBS_DOWN'); |
However, Bot.tsx never declares this state nor passes these props to <BotBubble> (around src/components/Bot.tsx#L2667), so onMessageRatingChange?.() is a no-op and currentRating() falls back to props.message.rating, which is only written to localStorage (saveToLocalStorage) — not to the in-memory messages signal. Hence no re-render until the history is reloaded from localStorage on refresh.
Proposed fix
Wire up the missing state in Bot.tsx (~3 lines):
const [messageRatings, setMessageRatings] = createSignal<Record<string, FeedbackRatingType>>({});
and pass to <BotBubble>:
messageRatings={messageRatings()}
onMessageRatingChange={(messageId, rating) => setMessageRatings((prev) => ({ ...prev, [messageId]: rating }))}
Happy to submit a PR for this.
Environment
- flowise-embed: 3.1.6 (also reproducible on current
main)
Describe the bug
When chat feedback is enabled, clicking the thumbs up / thumbs down button on a bot message does not update the button state. The feedback IS saved correctly (it appears in the Flowise server DB and in localStorage), but the icon only shows the rated state after refreshing the page.
To Reproduce
Expected behavior
The thumb icon should reflect the rating immediately after clicking.
Root cause
BotBubble.tsxalready supports reactive rating updates via themessageRatings/onMessageRatingChangeprops:FlowiseChatEmbed/src/components/bubbles/BotBubble.tsx
Lines 42 to 43 in 9f6ac51
FlowiseChatEmbed/src/components/bubbles/BotBubble.tsx
Line 75 in 9f6ac51
FlowiseChatEmbed/src/components/bubbles/BotBubble.tsx
Line 210 in 9f6ac51
FlowiseChatEmbed/src/components/bubbles/BotBubble.tsx
Line 240 in 9f6ac51
However,
Bot.tsxnever declares this state nor passes these props to<BotBubble>(aroundsrc/components/Bot.tsx#L2667), soonMessageRatingChange?.()is a no-op andcurrentRating()falls back toprops.message.rating, which is only written to localStorage (saveToLocalStorage) — not to the in-memory messages signal. Hence no re-render until the history is reloaded from localStorage on refresh.Proposed fix
Wire up the missing state in
Bot.tsx(~3 lines):and pass to
<BotBubble>:Happy to submit a PR for this.
Environment
main)