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

[BUG]: IPackagesClient.GetAllForOrg() sometimes returns not all packages #2987

Open
1 task done
DANIILSKRIPCHENKO opened this issue Dec 17, 2024 · 0 comments
Open
1 task done
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented

Comments

@DANIILSKRIPCHENKO
Copy link

What happened?

I am using this code to fetch all npm packages from organization:

    public async Task<IReadOnlyCollection<string>> ListAsync()
    {
        var allPackages = new List<Package>();
        IReadOnlyCollection<Package> packages;

        var startPage = 0;
        const int pageSize = 100;
        do
        {
            var apiOptions = new ApiOptions
            {
                StartPage = startPage,
                PageCount = 1,
                PageSize = pageSize
            };

            packages = await _client.Packages.GetAllForOrg("my-org", PackageType.Npm, apiOptions);

            allPackages.AddRange(packages);
            startPage++;
        } while (packages.Count == pageSize);

        return allPackages.Select(package => package.Name).ToArray();
    }

Sometimes I notice that not all packages were fetched. This happends not always. Probably once every 50 times.

Versions

.NET, 13.0.1

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@DANIILSKRIPCHENKO DANIILSKRIPCHENKO added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Dec 17, 2024
@nickfloyd nickfloyd moved this from 🆕 Triage to 🔥 Backlog in 🧰 Octokit Active Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented
Projects
Status: 🔥 Backlog
Development

No branches or pull requests

1 participant