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

Fix turnstile's UpdateTurnstileWidgetParams #3594

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

punkeel
Copy link
Member

@punkeel punkeel commented Nov 12, 2024

Description

We do not allow changing the region, so remove that.

There is a meaningful difference between setting a field to nil vs false: in one case, the previous value is kept. In the other, the false is used. With omitempty, go did the wrong thing–and prevented setting values to false (as they would NOT be sent over the wire).

Has your change been tested?

🤷

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)

I guess it's technically a breaking change to fix this. The alternative is to either always set all fields, but then UpdateTurnstileWidgetParams{domains: ...} would override EVERYTHING else, and that is a much worse breaking 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 in cloudflare/api-schemas
    and relies on stable APIs.

@punkeel punkeel force-pushed the maxime/fix-turnstile-update branch from e1e64e1 to 2a46f62 Compare November 12, 2024 13:55
- We do not allow changing the region
- There is a meaningful difference between setting a field to nil vs false:
  in one case, the previous value is kept. In the other, the false is used.
  With omitempty, go did the wrong thing - and prevented setting values to
  false (as they would NOT be sent over the wire).
@punkeel punkeel force-pushed the maxime/fix-turnstile-update branch from 2a46f62 to e69380e Compare November 12, 2024 13:56
@punkeel
Copy link
Member Author

punkeel commented Nov 12, 2024

changelog failed because:

go: downloading golang.org/x/exp/typeparams v0.0.0-20221212164502-fae10dda9338
go: golang.org/x/tools/cmd/goimports@latest (in golang.org/x/tools@v0.27.0): go.mod:3: invalid go version '1.22.0': must match format 1.23
internal/tools/tools.go:22: running "go": exit status 1

don't see how that's related to my PR

@jacobbednarz jacobbednarz merged commit 72fcc88 into cloudflare:master Nov 12, 2024
8 of 9 checks passed
@github-actions github-actions bot added this to the v0.110.0 milestone Nov 12, 2024
Copy link
Contributor

This functionality has been released in v0.110.0.

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

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 20, 2024
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.

2 participants