mirror of
https://github.com/block/goose.git
synced 2026-07-17 12:56:20 +02:00
debug: Fix session ID mismatch in useSessionSharing for Matrix mode
- Use Matrix room ID as session ID when in Matrix mode - Add extensive debugging for session ID configuration - The issue was that useSessionSharing was filtering messages by session ID - Matrix messages use different session ID than local Goose session - Need to align session IDs so useSessionSharing processes Matrix messages - Added logs to track session ID matching and message processing
This commit is contained in:
@@ -71,13 +71,24 @@ export default function Pair({
|
||||
const [hasLoadedMatrixHistory, setHasLoadedMatrixHistory] = useState(false);
|
||||
|
||||
// Session sharing hook for Matrix collaboration
|
||||
// In Matrix mode, we need to use a session ID that matches what's being sent in Matrix messages
|
||||
const effectiveSessionId = isMatrixMode && matrixRoomId ? matrixRoomId : (chat.sessionId || 'default');
|
||||
|
||||
console.log('🔧 useSessionSharing configuration:', {
|
||||
effectiveSessionId,
|
||||
isMatrixMode,
|
||||
matrixRoomId,
|
||||
chatSessionId: chat.sessionId
|
||||
});
|
||||
|
||||
const sessionSharing = useSessionSharing({
|
||||
sessionId: chat.sessionId || 'default',
|
||||
sessionId: effectiveSessionId,
|
||||
sessionTitle: chat.title || `Matrix Collaboration ${matrixRoomId?.substring(0, 8) || 'Session'}`,
|
||||
messages: chat.messages,
|
||||
onMessageSync: (message) => {
|
||||
// Handle synced messages from Matrix session participants
|
||||
console.log('💬 Synced message from Matrix shared session:', message);
|
||||
console.log('💬 Session ID match check:', { effectiveSessionId, isMatrixMode, matrixRoomId });
|
||||
// Add the synced message to local chat
|
||||
setChat(prevChat => ({
|
||||
...prevChat,
|
||||
|
||||
Reference in New Issue
Block a user