Fix double boolean conversion in format_list#3
Open
z-image wants to merge 1 commit intoljadach:mainfrom
Open
Conversation
parse_lists_response already converts string "1"/"0" to boolean, but format_list compared the result against "1" again, causing True == "1" to evaluate to False. This made all smart lists appear as non-smart in get_lists output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ljadach
requested changes
Mar 3, 2026
Owner
ljadach
left a comment
There was a problem hiding this comment.
Thanks for identifying this bug — the double boolean conversion is real and well-diagnosed!
However, the fix introduces a regression in other code paths. format_list() is called from two places:
get_lists(viaparse_lists_response) — input has already been converted to booleans (True/False). Your fix works correctly here.add_list,rename_list,archive_list,unarchive_list— these pass raw RTM API responses directly toformat_list(), where the values are still strings ("1"/"0"). After this change, those paths would return raw strings instead of booleans.
A more robust fix would be one of:
- Make
format_listhandle both input types, e.g."smart": lst.get("smart") in (True, "1") - Remove the conversion from
parse_lists_responseand letformat_listbe the sole converter - Stop calling
format_liston already-parsed data inget_lists
The test change also masks this by switching inputs from strings to booleans, which no longer covers the raw API string path.
Would you be open to adjusting the fix to handle both caller contexts?
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.
Summary
parse_lists_responseconverts RTM string values ("1"/"0") to booleansformat_listthen compared these booleans against "1" again (True == "1"→False)smart: falseinget_listsoutputarchivedandlockedfieldsTest plan
get_listsnow correctly showssmart: truefor smart lists (1MTD, 1MTD Now, etc.)