Skip to content

fix(console): treat string "false" as not stop-all on /api/stop - #111

Open
Faisal01011 wants to merge 2 commits into
google:mainfrom
Faisal01011:fix/stop-endpoint-false-string
Open

Faisal01011 wants to merge 2 commits into
google:mainfrom
Faisal01011:fix/stop-endpoint-false-string

Conversation

@Faisal01011

Copy link
Copy Markdown

Summary

POST /api/stop overwrote the query-param all flag with bool(body["all"]).
Python treats any non-empty string as true, so {"all": "false"} cancelled
every running task.

Parse JSON/query-like string booleans explicitly and keep session-scoped stops scoped.

Fixes #36

Test plan

  • Unit tests for coerce_bool and /api/stop body/query combinations
  • CI make test / make lint / make typecheck

JSON body values like "false" were coerced with bool(), which is True
for any non-empty string, so a scoped stop cancelled every task.

Fixes google#36
@Faisal01011

Copy link
Copy Markdown
Author

Note: #37 and #50 already target this bug. Happy to close this if one of those is preferred.

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 this pull request may close these issues.

Stop endpoint treats string "false" as a request to stop all tasks

1 participant