Skip to content

Real-Time (Polling) Shared Progress for Concurrent Same-URL Chat Creation #6

@avishek0769

Description

@avishek0769

Summary

If multiple users create chats for the same docs URL and same mode at the same time, all should see shared progress from a single ingestion job.

Problem

Progress tracking is currently keyed per chat/job, so parallel requests for the same source can produce duplicate ingestion and inconsistent progress visibility.

Expected Solution

Introduce source-level ingestion lock and progress channel keyed by source identity (normalizedUrl + mode). First request starts ingestion; subsequent requests subscribe to the same in-flight progress and attach when complete.

Scope

  • backend/controllers/chat.controller.js
  • backend/chatWorker.js
  • Redis key strategy and queue deduplication logic
  • src/pages/Dashboard.tsx polling/progress display behavior

Acceptance Criteria

  • Concurrent same-source creations do not enqueue duplicate ingestion work.
  • All involved users/chats receive consistent progress updates.
  • Completion attaches each waiting chat to the produced source/index.
  • Failure state is propagated consistently to all subscribers.

Notes

Current status/progress keying can be redesigned around chatSource identity instead of chat id.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendBackend issuesenhancementNew feature or requestmediumThis is issue is not easy to solve but not hard

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions