Skip to content

bug: Thumbs up/down rating state not reflected in UI until page refresh #395

Description

@iwc-byronwu

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

  1. Enable Chat Feedback on a chatflow
  2. Embed the chatbot on a page (tested with flowise-embed 3.1.6 from CDN)
  3. Send a message, then click 👍 on the bot's reply
  4. The feedback content dialog opens and the feedback is saved, but the thumb icon does not change to the rated (green/disabled) state
  5. 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:

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions