Skip to content

Overwritten chats when they aren't fully loaded #198

Closed

Description

@AnthonyRonning

When you have a very long chat there is a glitch that happens while its loading if you type something, and submit it, it will overwrite your entire chat and also relabel it as a new title. And you will lose 100% of your original chat log, and images.

Activity

  1. AnthonyRonning commented on Aug 16, 2025

    @AnthonyRonning
    ContributorAuthor

    @claude can you investigate this and fix it on a new branch? I believe in cases where users try to load a chat and it isn't fully loaded yet, they might still be allowed to "chat with it" and thus overwrite their previous chat with a brand new one.

    It's possible a very simple fix to this will be to disable the input box (we do this a lot for various reasons already) until the chat is fully loaded.

  2. claude commented on Aug 16, 2025

    @claude
    Contributor

    Claude finished @AnthonyRonning's task —— View job • claude/issue-198-20250816-1541 • Create PR ➔


    Fixed Chat Overwrite Bug ✅

    I successfully investigated and fixed the issue where users can overwrite chats while they're still loading.

    Todo List:

    • Analyze codebase to understand chat loading mechanism
    • Find existing patterns for disabling input boxes
    • Identify chat loading state management
    • Implement input box disabling during chat loading
    • Run formatting, linting, and build commands
    • Test the implementation
    • Commit and push changes

    Problem Analysis:

    The issue occurred because the chat input wasn't disabled during the loading phase when fetching existing chat data. The input was only disabled during streaming responses, allowing users to accidentally overwrite chat content while the original chat was still loading.

    Solution Implemented:

    1. Exposed isPending state from the useChatSession hook (useChatSession.ts:320)
    2. Updated chat route to destructure and use the isPending state (_auth.chat.$chatId.tsx:194)
    3. Enhanced input disabling logic to include loading state alongside streaming state (_auth.chat.$chatId.tsx:591)

    Technical Details:

    • The ChatBox component already had robust input disabling patterns using the isStreaming prop
    • The useChatSession hook was already tracking loading state via React Query's isPending but wasn't exposing it
    • The fix follows existing code conventions and patterns perfectly

    Result:

    Now when users navigate to a chat that's still loading, the input box will be disabled until the chat content is fully loaded, preventing accidental overwrites.


  3. added a commit that references this issue on Aug 16, 2025
    d926a0f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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