豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

[NSJ -> STJ]Migrate AutoComplete#7298

Draft
Nigusu-Allehu wants to merge 2 commits intodev-feature-nsj-stj-migrationfrom
dev-nyenework-autocomplete-stj
Draft

[NSJ -> STJ]Migrate AutoComplete#7298
Nigusu-Allehu wants to merge 2 commits intodev-feature-nsj-stj-migrationfrom
dev-nyenework-autocomplete-stj

Conversation

@Nigusu-Allehu
Copy link
Copy Markdown
Member

@Nigusu-Allehu Nigusu-Allehu commented Apr 17, 2026

Bug

Fixes:
Related: NuGet/Home#14846

Description

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.


var queryUri = queryUrl.Uri;
var results = await _client.GetJObjectAsync(
AutoCompleteModel results = await _client.ProcessStreamAsync(
Copy link
Copy Markdown

@richlander richlander Apr 17, 2026

Choose a reason for hiding this comment

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

I am surprised that AutoCompleteModel is always non-null. Is that correct?

Does this library not have nullable enabled?

// Resolve all the objects
var outputs = new List<string>();
foreach (var result in data)
if (results?.Data == null)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You could adopt the null-coalescing syntax:

var returnValue = results?.Data.Where(item => item != null && item.StartsWith(packageIdPrefix, StringComparison.OrdinalIgnoreCase));

return returnValue ?? Enumerable.Empty<string>();

Or some variant of that.

var results = await _client.GetJObjectAsync(
AutoCompleteModel results = await _client.ProcessStreamAsync(
new HttpSourceRequest(queryUri, logger),
async stream =>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I don't know what the team code style is, if they link lamdas defined ahead of the method call or within it.

@Nigusu-Allehu Nigusu-Allehu self-assigned this Apr 18, 2026
@Nigusu-Allehu Nigusu-Allehu force-pushed the dev-nyenework-autocomplete-stj branch from 01dc4d3 to 6f4e797 Compare April 20, 2026 16:34
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.

2 participants