diff --git a/.github/workflows/build-multiarch.yml b/.github/workflows/build-multiarch.yml index 31471517..e7c0a784 100644 --- a/.github/workflows/build-multiarch.yml +++ b/.github/workflows/build-multiarch.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest arch-suffix: amd64 - platform: linux/arm64 - runs-on: ubuntu-24.04-arm + runs-on: ubuntu-24.04-arm arch-suffix: arm64 runs-on: ${{ matrix.runs-on }} @@ -117,4 +117,4 @@ jobs: phact/openrag-opensearch:$VERSION-arm64 docker buildx imagetools create -t phact/openrag-opensearch:latest \ phact/openrag-opensearch:$VERSION-amd64 \ - phact/openrag-opensearch:$VERSION-arm64 \ No newline at end of file + phact/openrag-opensearch:$VERSION-arm64 diff --git a/frontend/src/app/chat/page.tsx b/frontend/src/app/chat/page.tsx index 995063d6..dca8084e 100644 --- a/frontend/src/app/chat/page.tsx +++ b/frontend/src/app/chat/page.tsx @@ -70,7 +70,7 @@ interface RequestBody { function ChatPage() { const isDebugMode = process.env.NODE_ENV === 'development' || process.env.NEXT_PUBLIC_OPENRAG_DEBUG === 'true' const { user } = useAuth() - const { endpoint, setEndpoint, currentConversationId, conversationData, setCurrentConversationId, addConversationDoc, forkFromResponse, refreshConversations, previousResponseIds, setPreviousResponseIds, setPlaceholderConversation } = useChat() + const { endpoint, setEndpoint, currentConversationId, conversationData, setCurrentConversationId, addConversationDoc, forkFromResponse, refreshConversations, previousResponseIds, setPreviousResponseIds } = useChat() const [messages, setMessages] = useState([ { role: "assistant", @@ -436,7 +436,7 @@ function ChatPage() { } ]) } - }, [conversationData, currentConversationId, isUserInteracting, isForkingInProgress, lastForkTimestamp]) + }, [conversationData, currentConversationId, isUserInteracting, isForkingInProgress, lastForkTimestamp, setPreviousResponseIds]) // Listen for file upload events from navigation useEffect(() => { @@ -508,7 +508,7 @@ function ChatPage() { window.removeEventListener('fileUploadComplete', handleFileUploadComplete as EventListener) window.removeEventListener('fileUploadError', handleFileUploadError as EventListener) } - }, [endpoint]) + }, [endpoint, setPreviousResponseIds]) // Handle click outside to close dropdown useEffect(() => { diff --git a/frontend/src/contexts/auth-context.tsx b/frontend/src/contexts/auth-context.tsx index c366533c..6f676ff4 100644 --- a/frontend/src/contexts/auth-context.tsx +++ b/frontend/src/contexts/auth-context.tsx @@ -1,6 +1,6 @@ "use client" -import React, { createContext, useContext, useState, useEffect, ReactNode } from 'react' +import React, { createContext, useContext, useState, useEffect, useCallback, ReactNode } from 'react' interface User { user_id: string @@ -40,7 +40,7 @@ export function AuthProvider({ children }: AuthProviderProps) { const [isLoading, setIsLoading] = useState(true) const [isNoAuthMode, setIsNoAuthMode] = useState(false) - const checkAuth = async () => { + const checkAuth = useCallback(async () => { try { const response = await fetch('/api/auth/me') @@ -72,7 +72,7 @@ export function AuthProvider({ children }: AuthProviderProps) { console.log('Backend not ready, retrying in 2 seconds...') setTimeout(checkAuth, 2000) } - } + }, []) const login = () => { // Don't allow login in no-auth mode @@ -157,7 +157,7 @@ export function AuthProvider({ children }: AuthProviderProps) { useEffect(() => { checkAuth() - }, []) + }, [checkAuth]) const value: AuthContextType = { user, diff --git a/frontend/src/contexts/chat-context.tsx b/frontend/src/contexts/chat-context.tsx index c77fa2ea..cc734d99 100644 --- a/frontend/src/contexts/chat-context.tsx +++ b/frontend/src/contexts/chat-context.tsx @@ -20,6 +20,7 @@ interface ConversationData { messages: ConversationMessage[] endpoint: EndpointType response_id: string + title: string [key: string]: unknown } @@ -32,7 +33,7 @@ interface ChatContextType { chat: string | null langflow: string | null } - setPreviousResponseIds: (ids: { chat: string | null; langflow: string | null }) => void + setPreviousResponseIds: (ids: { chat: string | null; langflow: string | null } | ((prev: { chat: string | null; langflow: string | null }) => { chat: string | null; langflow: string | null })) => void refreshConversations: () => void refreshTrigger: number loadConversation: (conversation: ConversationData) => void