Fix MessageContext exhaustive-deps for CI builds
Deploy Beta / unit-tests (push) Successful in 12s
Unit Tests / test (push) Successful in 11s
Deploy Beta / deploy-beta (push) Successful in 2m24s

Stabilize schedulePostStreamRefetch with useCallback so CI=true ESLint no longer fails beta deploy.
This commit is contained in:
2026-08-04 07:05:55 -05:00
parent a7c5d1a2aa
commit fb3e138ea2
@@ -1,4 +1,4 @@
import { createContext, ReactNode, useContext, useEffect, useRef, useState } from "react"; import { createContext, ReactNode, useCallback, useContext, useEffect, useRef, useState } from "react";
import { WebSocketContext } from "./WebSocketContext"; import { WebSocketContext } from "./WebSocketContext";
import { AccountContext } from "./AccountContext"; import { AccountContext } from "./AccountContext";
import { ConversationContext } from "./ConversationContext"; import { ConversationContext } from "./ConversationContext";
@@ -128,7 +128,7 @@ const MessageProvider = ( {children}: MessageProviderProps) => {
} }
} }
const schedulePostStreamRefetch = () => { const schedulePostStreamRefetch = useCallback(() => {
if (refetchTimerRef.current) clearTimeout(refetchTimerRef.current) if (refetchTimerRef.current) clearTimeout(refetchTimerRef.current)
const conversationId = selectedConversationRef.current const conversationId = selectedConversationRef.current
if (!conversationId) return if (!conversationId) return
@@ -137,7 +137,7 @@ const MessageProvider = ( {children}: MessageProviderProps) => {
refetchTimerRef.current = setTimeout(() => { refetchTimerRef.current = setTimeout(() => {
void GetConversationDetails(conversationId) void GetConversationDetails(conversationId)
}, 800) }, 800)
} }, [])
useEffect(() => { useEffect(() => {
GetConversationDetails(selectedConversation) GetConversationDetails(selectedConversation)
@@ -316,7 +316,7 @@ const MessageProvider = ( {children}: MessageProviderProps) => {
/* unsubscribe from channel during cleanup */ /* unsubscribe from channel during cleanup */
unsubscribe(channelName) unsubscribe(channelName)
} }
}, [account, subscribe, unsubscribe, conversationDetails, selectedConversation, setSelectedConversation]) }, [account, subscribe, unsubscribe, conversationDetails, selectedConversation, setSelectedConversation, schedulePostStreamRefetch])
return( return(