Skip to content

Conversation

@Tomass673
Copy link
Collaborator

@Tomass673
Copy link
Collaborator Author

@veliseev93 please take a look

@veliseev93 veliseev93 assigned Tomass673 and unassigned veliseev93 Dec 11, 2025
mutationFn: ({ taskId }) => tasksService.stopTask(taskId),

onSuccess: (_, { chatId, lastMessageId }) => {
patchChatQueryData(chatId, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you check if we just need to tweak patchChatQueryData a bit?

It seems that in some cases, using patchChatQueryData doesn't trigger a rerender, causing isResponseGenerating in the component to return stale value.

Try this fix, for example (please be careful and test):

import { merge } from 'lodash-es';
import { queryClient } from '@open-webui-react-native/shared/data-access/query-client';
import { chatQueriesKeys } from '../chat-queries-keys';
import { ChatResponse } from '../models';

export const patchChatQueryData = (chatId: string, partialData: Partial<ChatResponse>): void => {
  queryClient.setQueryData<ChatResponse>(chatQueriesKeys.get(chatId).queryKey, (draft) => {
    if (!draft) {
      return undefined;
    }

    return new ChatResponse(merge(draft, partialData));
  });
};

@Tomass673 Tomass673 assigned veliseev93 and unassigned Tomass673 Dec 12, 2025
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.

3 participants