Skip to content

Conversation

@roomote
Copy link
Collaborator

@roomote roomote commented Jun 19, 2025

  • Fixed race condition in CodeIndexOrchestrator where clearIndexData and startIndexing could conflict
  • Separated _isProcessing check from state validation in startIndexing for better error reporting
  • Made webview startIndexing handler properly await the operation
  • Removed _isProcessing reset from stopWatcher to prevent interference with calling methods
  • Added comprehensive tests for clearIndexData and startIndexing sequence
  • Ensures users can successfully re-index after clearing index data

Important

Fixes race condition in CodeIndexOrchestrator by improving startIndexing logic and adding tests for re-indexing sequence.

  • Behavior:
    • Fixes race condition in CodeIndexOrchestrator by separating _isProcessing check from state validation in startIndexing().
    • Ensures webviewMessageHandler.ts properly awaits startIndexing().
    • Removes _isProcessing reset from stopWatcher() to prevent interference.
  • Tests:
    • Adds tests in manager.spec.ts for clearIndexData and startIndexing sequence.
    • Tests handle rapid calls and ensure no errors in sequence execution.
  • Misc:
    • Ensures users can re-index after clearing index data without errors.

This description was created by Ellipsis for 65e1821. You can customize this summary. It will automatically update as commits are pushed.

- Fixed race condition in CodeIndexOrchestrator where clearIndexData and startIndexing could conflict
- Separated _isProcessing check from state validation in startIndexing for better error reporting
- Made webview startIndexing handler properly await the operation
- Removed _isProcessing reset from stopWatcher to prevent interference with calling methods
- Added comprehensive tests for clearIndexData and startIndexing sequence
- Ensures users can successfully re-index after clearing index data
@roomote roomote requested review from cte, jr and mrubens as code owners June 19, 2025 15:54
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Jun 19, 2025
this.stateManager.state !== "Error" &&
this.stateManager.state !== "Indexed")
) {
if (this._isProcessing) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In startIndexing(), the early return when _isProcessing is true may drop an indexing request rather than waiting for clearIndexData to complete. The rapid call test expects the call to wait until the current operation finishes. Consider implementing a waiting/queuing mechanism (e.g. using a simple loop or a p-wait-for) so that if _isProcessing is true, startIndexing waits until it’s false before proceeding.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jun 19, 2025
@daniel-lxs
Copy link
Member

Closing, the actual issue got solved in #4857.

Also this: await manager.startIndexing() should never be done, awaiting for the indexing process will basically halt execution for any function/method that awaits it until the indexing process finishes which might takes minutes to complete.

@daniel-lxs daniel-lxs closed this Jun 19, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jun 19, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants