nes: fix: address _performFetch review comments#309000
Merged
Conversation
- 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
Contributor
There was a problem hiding this comment.
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.ErrortoFetchResult.FetchFailureto avoid ambiguity with the built-inErrortype and improveinstanceofreadability. - Registers
fetchResultPromise.then/.catch/.finallyhandlers beforeawait Promise.race(...)sologContext.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
chrmarti
approved these changes
Apr 10, 2026
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.
Address code review comments from #308778:
FetchResult.ErrortoFetchResult.FetchFailure— avoids confusion with the built-inErrorclass and improves readability ofinstanceofchecks.fetchResultPromise.then/.catch/.finallyhandlers beforeawait Promise.race()— ensureslogContext.setFetchEndTime()runs even on early-return paths (ModelNotFound, NoSuggestions, fetch errors), fixing missing fetch-end telemetry timestamps.Part of #308744