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

Accounts not working as expected when needed to fetch all accounts #909

Closed
2 tasks done
sbs2001 opened this issue May 27, 2022 · 3 comments · Fixed by #910
Closed
2 tasks done

Accounts not working as expected when needed to fetch all accounts #909

sbs2001 opened this issue May 27, 2022 · 3 comments · Fixed by #910

Comments

@sbs2001
Copy link

sbs2001 commented May 27, 2022

Confirmation

  • My issue isn't already found on the issue tracker.
  • I have replicated my issue using the latest version of the library and it is still present.

cloudflare-go version

master

Go environment

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/shivam/.cache/go-build"
GOENV="/home/shivam/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/shivam/.asdf/installs/golang/1.18.1/packages/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/shivam/.asdf/installs/golang/1.18.1/packages"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/shivam/.asdf/installs/golang/1.18.1/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/shivam/.asdf/installs/golang/1.18.1/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18.1"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/shivam/work/cs-cloudflare-bouncer/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3327606679=/tmp/go-build -gno-record-gcc-switches"

Expected output

In older version of this library api.Accounts(ctx, cloudflare.PaginationOptions{}) used to fetch all the accounts a particular user had access to.

Actual output

After the update, the function has been changed to api.Accounts(ctx, cloudflare.AccountsListParams{}) . This particular call doesn't fetch any accounts at all.

After digging into code it seems that it's appending name= parameter to this particular api call with null value. Hence we get no accounts.

Code demonstrating the issue

api.Accounts(ctx, cloudflare.AccountsListParams{})

func (api *API) Accounts(ctx context.Context, params AccountsListParams) ([]Account, ResultInfo, error) {

Steps to reproduce

Just use api.Accounts(ctx, cloudflare.AccountsListParams{}), in latest version. It's not returning all accounts as expected

References

No response

@jacobbednarz
Copy link
Member

thanks, addressed by #910

@sbs2001
Copy link
Author

sbs2001 commented May 27, 2022

Thanks for the quick fix. May I know when the next release of this library (including this fix) be published ?

@jacobbednarz
Copy link
Member

it is roughly a fortnightly cadence and we had a release a couple of days ago. in the meantime, you'll need to use the git references if you'd like this change immediately.

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 a pull request may close this issue.

2 participants