fix(indexing): WebSocket race condition, NaN stats, file streaming (#154)#160
Merged
DevanshuNEU merged 2 commits intoJan 6, 2026
Merged
Conversation
…#154) Bug fixes: 1. NaN/division by zero - Added safe value guards in IndexingProgress - safePercent, safeFilesProcessed, safeFilesTotal, safeFunctionsFound - Shows 'Starting...' when filesTotal is 0 - Stats show '—' instead of NaN/0/0 2. AnimatePresence warnings - Moved error state inside AnimatePresence - Error state now has proper key and exit animation - Visibility conditions properly exclude simultaneous renders - Changed error styling from red to amber (friendlier) 3. Session state - Error states now properly clear other states - showUrlInput excludes error state - showValidation excludes error state - showIndexing excludes wsHasError Closes OpenCodeIntel#154
|
@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. |
38afd04 to
95e6681
Compare
Fixes: - Add delay before WS close to ensure client receives completion event - Align stat field names between backend and frontend - Add current_file to progress events for streaming display - Preserve completed state when WebSocket disconnects Root cause: Backend closed WebSocket immediately after sending completion event, causing race condition where frontend's onclose fired before onmessage could process the completion. Closes OpenCodeIntel#154
95e6681 to
85f229f
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix Indexing Bugs (#154)
Summary
Fixes critical bugs in the playground indexing flow that caused:
Root Cause
Backend was closing WebSocket immediately after sending 'completed' event. Due to network/event loop timing, frontend's
onclosehandler fired beforeonmessagecould process the completion event → state never updated → blank screen.Additionally, backend and frontend had mismatched field names for stats.
Changes
Backend
ws_playground.pyanonymous_indexer.pyfiles_indexed→files_processed,functions_found→functions_indexed,time_taken_seconds→indexing_time_secondsanonymous_indexer.pycurrent_fileparameter to progress callbackindexer_optimized.pycurrent_fileto progress eventsFrontend
useIndexingWebSocket.tsuseIndexingWebSocket.tsTesting
https://github.com/pallets/flask)Before/After
Before:
NaN,NaN,NaNsAfter:
83 Files,1,616 Functions,81.1sCloses #154