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]: total_count missing from paginated response types #652

Closed
1 task done
robertbrignull opened this issue Feb 3, 2025 · 4 comments · Fixed by #653
Closed
1 task done

[BUG]: total_count missing from paginated response types #652

robertbrignull opened this issue Feb 3, 2025 · 4 comments · Fixed by #653
Labels
released Type: Bug Something isn't working as documented typescript Relevant to TypeScript users only

Comments

@robertbrignull
Copy link

What happened?

In https://github.com/github/vscode-codeql/blob/main/extensions/ql-vscode/src/databases/code-search-api.ts we're using octokit.paginate.iterator(octokit.rest.search.code) and on the response we're checking response.data.total_count. In the upgrade from 21.0.2 to 21.1.0 this field seems to have disappeared. It's still there in the response from GitHub (i.e. making the request with curl) but it gets deleted before it reaches our code.

We're wondering if this change came from #637 but we're not sure and also check if this was an intentional effect or not. Alternatively, is there another recommended way to access the total_count field?

Versions

@octokit/rest v21.1.0

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct
@robertbrignull robertbrignull added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Feb 3, 2025
Copy link
Contributor

github-actions bot commented Feb 3, 2025

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@wolfy1339
Copy link
Member

That only affects types, the field is still there

@wolfy1339 wolfy1339 added typescript Relevant to TypeScript users only and removed Status: Triage This is being looked at and prioritized labels Feb 3, 2025
@wolfy1339 wolfy1339 changed the title [BUG]: total_count missing from paginated response [BUG]: total_count missing from paginated response types Feb 3, 2025
wolfy1339 added a commit that referenced this issue Feb 3, 2025
@wolfy1339 wolfy1339 moved this from 🆕 Triage to 🏗 In progress in 🧰 Octokit Active Feb 4, 2025
@robertbrignull
Copy link
Author

Thanks for looking into this!

That only affects types, the field is still there

I agree 👍🏼

I briefly got myself confused because the data field is an array but also has these other fields. This means if you do JSON.stringify then it only shows the array part, but the other fields are there on the javascript object and you can access them directly by name.

wolfy1339 added a commit that referenced this issue Feb 13, 2025
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in 🧰 Octokit Active Feb 13, 2025
Copy link
Contributor

🎉 This issue has been resolved in version 11.4.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Type: Bug Something isn't working as documented typescript Relevant to TypeScript users only
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants