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] Cannot set Custom Reward is_paused field to false #326

Open
TulioAbreu opened this issue Jun 17, 2024 · 0 comments
Open

[Bug] Cannot set Custom Reward is_paused field to false #326

TulioAbreu opened this issue Jun 17, 2024 · 0 comments

Comments

@TulioAbreu
Copy link

What is the problem?

I just found recently that Twitch had this mock api for testing requests without me needing to be a partner. While testing my integration, I found that I could not change Custom Rewards boolean field is_paused to false. I can set it to true, but not the inverse.

I'm not familiarized with Golang, but tried to investigate the source code and found this code snippet, that may be related:
https://github.com/twitchdev/twitch-cli/blob/main/internal/database/sql_gen.go#L192C8-L194

		case bool:
			if !f {
				continue
			}

I may test it later, but from my quick view, this means that falsy f are ignored on update clause, right? Just as zero is ignored on integer clauses

Operating System

Windows WSL

Architecture Version (x86, x64, arm, etc)

x86

Steps to reproduce

  1. Setup and start mock-api
  2. Send an update (PATCH) request to /channel_points/custom_rewards changing the boolean field is_paused

When passing a true value, the request works and update the custom reward is_paused field. However, when we try to set this field as false, it does not happen. Here's a curl request:

curl 'http://localhost:3000/api/mock/channel_points/custom_rewards?broadcaster_id=36028131&id=a2279f06-0856-213d-02ba-99c9d2041cb6'   -X 'PATCH'   -H 'Accept: application/json, text/plain, */*'   -H 'Accept-Language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7'   -H 'Authorization: Bearer a87ee147eaa5469'   -H 'Client-Id: 9607c0f8e0f2a957877be84be7e21c'   -H 'Connection: keep-alive'   -H 'Content-Type: application/json'   -H 'DNT: 1'   -H 'Origin: http://localhost:3000'   -H 'Referer: http://localhost:3000/custom-rewards'   -H 'Sec-Fetch-Dest: empty'   -H 'Sec-Fetch-Mode: cors'   -H 'Sec-Fetch-Site: same-origin'   -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36'   -H 'sec-ch-ua: "Not/A)Brand";v="8", "Chromium";v="126", "Google Chrome";v="126"'   -H 'sec-ch-ua-mobile: ?0'   -H 'sec-ch-ua-platform: "Windows"'   --data-raw '{"is_paused":false}'

There's no error log, it will just return me the payload containing a custom reward with is_paused: true

Relevant log output

No response

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

No branches or pull requests

1 participant