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

Use new DNSListResponse object when paginating #1222

Merged
merged 7 commits into from
Feb 28, 2023

Conversation

MrMortbury
Copy link
Contributor

Removes the reuse of the DNSListResponse object when collating multiple pages of API requests as this was reusing the pointers used for the Proxied field.

Description

Fixes #1221

Move the declaration of the DNSListResponse variable to within the pagination loop to for go to create a new variable on each loop and stop the Proxied pointer of DNS records from being reused. A new variable of lastResultInfo was added outside the loop to allow the return of the ResultsInfo from the last page of the requests.

Has your change been tested?

Updated the TestListDNSRecordsPagination test and associated fixtures to replicate the issue describe in the bug. Test now pulls 2 pages and a total of 5 test records configured to replicate #1221. Test failed before the change and passed afterwards.
All other DNS tests have been run and pass without issue

Types of changes

What sort of change does your code introduce/modify?

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • This change is using publicly documented (api.cloudflare.com or developers.cloudflare.com) and stable APIs.

@MrMortbury MrMortbury changed the title Use new DNSListResponse object when paginating #1221 Use new DNSListResponse object when paginating Feb 28, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Feb 28, 2023

changelog detected ✅

.changelog/1222.txt Outdated Show resolved Hide resolved
@jacobbednarz jacobbednarz merged commit 5a6fa21 into cloudflare:master Feb 28, 2023
@jacobbednarz
Copy link
Member

thanks a bunch @MrMortbury 🍰

@github-actions github-actions bot added this to the v0.62.0 milestone Feb 28, 2023
github-actions bot pushed a commit that referenced this pull request Feb 28, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2023

This functionality has been released in v0.62.0.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@cloudflare cloudflare locked as resolved and limited conversation to collaborators Mar 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ListDNSRecords overwrites proxied value when paginated
2 participants