Skip to content

nes: fix: address _performFetch review comments#309000

Merged
ulugbekna merged 1 commit intomainfrom
ulugbekna/fix-fetchresult-review-comments
Apr 10, 2026
Merged

nes: fix: address _performFetch review comments#309000
ulugbekna merged 1 commit intomainfrom
ulugbekna/fix-fetchresult-review-comments

Conversation

@ulugbekna
Copy link
Copy Markdown
Contributor

Address code review comments from #308778:

  • Rename FetchResult.Error to FetchResult.FetchFailure — avoids confusion with the built-in Error class and improves readability of instanceof checks.
  • Move fetchResultPromise .then/.catch/.finally handlers before await Promise.race() — ensures logContext.setFetchEndTime() runs even on early-return paths (ModelNotFound, NoSuggestions, fetch errors), fixing missing fetch-end telemetry timestamps.

Part of #308744

- Rename FetchResult.Error to FetchResult.FetchFailure to avoid
  confusion with built-in Error class
- Move fetchResultPromise .then/.catch/.finally handlers before
  await Promise.race so early-return paths get setFetchEndTime()
  telemetry
Copilot AI review requested due to automatic review settings April 10, 2026 12:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses prior review feedback in the Copilot Xtab provider by clarifying fetch-result naming and ensuring fetch lifecycle telemetry/logging is consistently finalized even when _performFetch exits early.

Changes:

  • Renames FetchResult.Error to FetchResult.FetchFailure to avoid ambiguity with the built-in Error type and improve instanceof readability.
  • Registers fetchResultPromise .then/.catch/.finally handlers before await Promise.race(...) so logContext.setFetchEndTime() is executed for early-return paths (e.g., model-not-found / no-suggestions / fetch errors).
Show a summary per file
File Description
extensions/copilot/src/extension/xtab/node/xtabProvider.ts Renames the fetch failure result type and reorders fetch promise handler registration to ensure fetch-end logging/telemetry runs on early returns.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@ulugbekna ulugbekna merged commit 0e5f2c4 into main Apr 10, 2026
30 checks passed
@ulugbekna ulugbekna deleted the ulugbekna/fix-fetchresult-review-comments branch April 10, 2026 13:16
@vs-code-engineering vs-code-engineering bot added this to the 1.116.0 milestone Apr 10, 2026
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.

3 participants