Repository navigation
Conversation
The body ("OK"/"ERROR") was announced with Content-Length 0, so clients always
received an empty response and could not tell success from failure.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
settings_set_by_string_id() returns bool but returned ERROR_NOT_FOUND for an unknown name, which is non-zero and therefore true. /api/settings/set then answered OK although nothing was set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
POST /api/settings/setrepliesOKorERROR, but clients could not see either:Content-Length: 0, so theOK/ERRORtext was never delivered. Clients only got an empty200and could not tell whether a setting was saved.settings_set_by_string_id()returnsbool, but for an unknown name it returnedERROR_NOT_FOUND. That value is non-zero, so it read astrueand the API answeredOKalthough nothing was set.Fix: two one-line changes: send the real body length, and
return falsefor an unknown setting.Test: new
tests/py/test_settings_set.py(make test_py TESTS=settings_set):200 OK200 ERRORBoth tests pass with the fix and fail without it. Run natively on arm64 (Raspberry Pi 4, Ubuntu 24.04 container). I used
NO_SANITIZERS=2because ASan aborts there, see #311.I found this while building a small web app on top of the API: it reads the value back after every
set, because the reply could not be trusted.🤖 Generated with Claude Code