Skip to content

[Bug] Chat conversation history is lost on page refresh - No session persistence #45

@SandeepChauhan00

Description

@SandeepChauhan00

🐛 Bug Description

Chat conversation history is completely cleared when the page is refreshed (F5/Ctrl+R). Users lose their entire conversation including queries and responses, forcing them to start from scratch.


🔄 Steps to Reproduce

  1. Open the Knowledge Space Agent chat interface (http://localhost:3000)
  2. Send a message: "find EEG brain datasets"
  3. Wait for the response (success or error)
  4. Press F5 or Ctrl+R to refresh the page
  5. Observe the chat interface

✅ Expected Behavior

  • Conversation history should persist after page refresh
  • Previous queries and responses should remain visible
  • User should be able to continue the conversation seamlessly

❌ Actual Behavior

  • All conversation history is cleared
  • Only the default welcome message appears:

    "Hello! I'm your INCF KnowledgeSpace assistant..."

  • User loses all previous queries and responses

📸 Evidence

Before Refresh:
You: find EEG brain datasets
KnowledgeSpace Assistant: [Response displayed]

After Refresh:
KnowledgeSpace Assistant: Hello! I'm your INCF KnowledgeSpace assistant...
[Previous conversation GONE]


💥 Impact

Impact Area Description
User Experience Users lose their research progress
Productivity Must re-type queries after accidental refresh
Data Loss No way to recover previous conversations

🛠️ Suggested Solution

LocalStorage Persistence

// Save conversation to localStorage
localStorage.setItem('chatHistory', JSON.stringify(messages));

// Restore on page load
const savedHistory = localStorage.getItem('chatHistory');
if (savedHistory) {
  setMessages(JSON.parse(savedHistory));
}

🌍 Environment

  • Browser: Chrome
  • OS: Windows
  • App Version: Latest

📋 Acceptance Criteria

  • Conversation persists after page refresh (F5)
  • Conversation persists after browser tab close/reopen
  • Works across all major browsers

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