Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cached/Uncached Packages checks can cause scan failure #179

Closed
digitalcoyote opened this issue Mar 14, 2024 · 1 comment
Closed

Cached/Uncached Packages checks can cause scan failure #179

digitalcoyote opened this issue Mar 14, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@digitalcoyote
Copy link
Owner

digitalcoyote commented Mar 14, 2024

Describe the bug
I was tired and used Gemini to assist with rewriting some code for a recent fix. Unsurprisingly Gemini had no idea what I meant and I missed it.

Expected behavior
Cached packages with the least recent checks are sent up to fill any requests sent to remote vulnerability sources when we would have a request with less than the maximum allowed by that service.

Additional context
Untested, but this looks more correct:

var rescanCount = Math.Min(128 - modUncached, cachedPackages.Length);
for (var i = cachedPackages.Length - 1; i >= 0; i--)
{
uncachedPkgs.Add(cachedPackages[i]);
}

cachedPackages = cachedPackages[..^rescanCount];

@digitalcoyote digitalcoyote added the bug Something isn't working label Mar 14, 2024
@digitalcoyote
Copy link
Owner Author

I've been trying to find time to put this fix in since Last Friday. If anyone wants to open a PR, I'd be happy to approve it as soon as I have time to review and publish. Hoping to get to this really soon either way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant