Skip to content

feat(frontend): Integrate WebSocket for real-time indexing progress#28

Merged
DevanshuNEU merged 3 commits into
OpenCodeIntel:mainfrom
DevanshuNEU:feature/websocket-indexing-progress
Dec 5, 2025
Merged

feat(frontend): Integrate WebSocket for real-time indexing progress#28
DevanshuNEU merged 3 commits into
OpenCodeIntel:mainfrom
DevanshuNEU:feature/websocket-indexing-progress

Conversation

@DevanshuNEU

Copy link
Copy Markdown
Collaborator

Problem

Frontend currently fakes indexing progress with setInterval. Backend has a working WebSocket endpoint (/ws/index/{repo_id}) that sends real progress updates, but frontend doesn't use it.

Solution

Connect to WebSocket with JWT token for actual real-time progress instead of simulated progress bar.

Changes Made

  • Add WS_URL helper in frontend/src/config/api.ts
  • Update RepoOverview.tsx to connect to WebSocket
  • Show real-time: files processed, functions indexed, percentage
  • Graceful fallback to HTTP if WebSocket fails
  • Handle WebSocket disconnection gracefully in backend
  • Use Supabase service role key for backend operations

Files Modified

Frontend:

  • frontend/src/config/api.ts
  • frontend/src/components/RepoOverview.tsx

Backend:

  • backend/main.py (WebSocket error handling)
  • backend/services/supabase_service.py (service role key)

Testing

  1. Login and add/select a repo
  2. Click "Re-index Repository"
  3. Watch real-time progress (Files: X/Y, Functions: Z)
  4. Progress bar disappears on completion

Closes #17

…deIntel#17)

- Connect to /ws/index/{repo_id} with JWT token
- Show real-time files processed, functions indexed, progress %
- Graceful fallback to HTTP if WebSocket fails
- Add WS_URL helper in config/api.ts

Closes OpenCodeIntel#17
- Backend: Use SUPABASE_SERVICE_ROLE_KEY to bypass RLS
- Frontend: Clear progress bar after indexing complete
- Frontend: Reset state on error
- Wrap all websocket.send_json in try/except
- Prevent crash when client disconnects during indexing
- Continue indexing even if client disconnects
@vercel

vercel Bot commented Dec 5, 2025

Copy link
Copy Markdown

@DevanshuNEU is attempting to deploy a commit to the Dev's projects Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Dec 5, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
opencodeintel Ready Ready Preview Comment Dec 5, 2025 9:45pm

@DevanshuNEU DevanshuNEU merged commit 91de35a into OpenCodeIntel:main Dec 5, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(frontend): Integrate WebSocket for real-time indexing progress

1 participant