Repository navigation
fix(clickup-app): include folder-contained lists in get_all_lists (#13808) - #13844
Conversation
get_all_lists walked each space with GET /space/{id}/list, which ClickUp
API v2 limits to folderless lists. Every list organised inside a folder —
the normal way a ClickUp workspace is laid out — was invisible: the
settings picker never offered it and task routing could not target it.
- get_folders() reads GET /space/{id}/folder; ClickUp embeds each
folder's lists in that response, so it is one call per space.
get_folder_lists() (GET /folder/{id}/list) covers a folder that
arrives without them.
- get_all_lists() appends folder lists after the folderless ones. They
carry folder_id and folder_name; `name` stays the bare list name
because task_detector matches spoken list names against it, and
nobody says "Sprint 1 / Bugs" out loud.
- A failed folder request makes get_all_lists return [] rather than the
folderless subset — the same discard-partial-results contract as the
github-app fetchers. A folderless-only answer after a failed folder
request is the original bug, made intermittent.
- The settings picker labels folder lists "Folder / List (Space)", since
two folders routinely hold a list with the same name.
Tests: test_clickup_client.py drives get_all_lists through a patched
requests seam with ClickUp v2-shaped responses — embedded folder lists,
the per-folder fallback, a 500 on either folder endpoint failing closed
to [], and a space with no folders keeping its folderless lists. Four of
the five fail on the old client (only "Inbox" comes back).
test_settings_page.py drives the real root handler with a stubbed
framework and asserts the folder label. Both suites are registered in
.github/checks-manifest.yaml (local + ci) and pass through `make
preflight` (15 checks).
Failure-Class: none
The list picker interpolated list and space names straight into <option> markup. Names are user-controlled on the ClickUp side, and the previous commit adds folder names to the same string, so a folder called <b>x</b> would have rendered as markup. Escape at the HTML boundary. Tests: test_settings_page.py renders the real root handler with a folder named <b>Sprint</b> and a space named "Eng & Co" and asserts both come out as text.
There was a problem hiding this comment.
All reported issues were addressed across 5 files
You’re at about 92% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact [email protected].
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
… test Review feedback on BasedHardware#13844: the escaping test only carried markup in the folder and space names, so a regression that stopped escaping the list name would have passed. The list is now named <script>Bugs</script> and the whole rendered <option> is asserted.
… test Review feedback on BasedHardware#13844: the escaping test only carried markup in the folder and space names, so a regression that stopped escaping the list name would have passed. The list is now named <script>Bugs</script> and the whole rendered <option> is asserted. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VAU5PGH57hXyipiE3zhNZk
5cc73d9 to
a6f66a8
Compare
|
Following up on payment for this one — merged 2026-09-14. I've emailed [email protected] with the full list of my merged bounty PRs, as the contribution guide asks under Paid Bounties ("claiming payment"). Leaving a note here too so it's on the thread rather than only in a mailbox. This one was proposed by another contributor (#13808) and mine was the PR that merged, so the amount is entirely at your discretion. Payout — crypto is easiest for me, USDC/USDT on either chain:
Happy to use whatever method is simplest on your side. Thanks! |
What changed and why
Fixes #13808.
get_all_listsinplugins/omi-clickup-app/clickup_client.pywalked each space withGET /space/{id}/list, which ClickUp API v2 limits to folderless lists. Every list organised inside a folder — the normal way a ClickUp workspace is laid out — was invisible to the plugin: the settings picker never offered it and task routing could not target it.get_folders()readsGET /space/{id}/folder. ClickUp embeds each folder's lists in that response, so it is one call per space;get_folder_lists()(GET /folder/{id}/list) covers a folder that arrives without them.get_all_lists()appends folder lists after the folderless ones, carryingfolder_idandfolder_name.namestays the bare list name becausetask_detectormatches spoken list names against it (lst["name"].lower() == spoken_lower, three places) — nobody says "Sprint 1 / Bugs" out loud.get_all_listsreturn[]rather than the folderless subset — the same discard-partial-results contract as the github-app fetchers (fix(github-app): page through repository labels #13546). A folderless-only answer after a failed folder request is the original bug, made intermittent.Folder / List (Space), since two folders routinely hold a list with the same name (every sprint has a "Bugs").<option>markup unescaped before, and this change adds folder names to the same string.Not changed, deliberately:
get_spaces/get_listskeep their pre-existing return-[]-on-error behaviour, and/refresh-listsstill reportssuccess: True, lists_count: 0after a failed fetch (pre-existing for every failure, now visible instead of silent for folders). Happy to tighten either in a follow-up.task_detector'slist_mapkeyed on barenamealso means two lists with the same name in different folders resolve to whichever came last — a pre-existing limitation that folder lists make more likely to hit; flagging rather than widening this PR.Product invariants affected
none
How it was verified
STORAGE_DIRpointed at a scratch dir,clickup_client.base_urlat the fake):POST /refresh-lists→ realget_all_lists→ realrequests→ real storage →GET /?uid=…. Result:{'success': True, 'lists_count': 5}— 1 folderless list plus 4 folder lists across two spaces, one via the non-embedded/folder/{id}/listfallback. The picker renderedInbox (Engineering),Sprint 1 / Bugs (Engineering),Sprint 1 / Features (Engineering),<b>Sprint 2</b> / Bugs (Engineering),Campaigns / Q4 Launch (Marketing). With the folder endpoint returning 500 the log reads❌ Error getting folder lists for space s1: Error getting folders: 500 - …and the result islists_count: 0, not a silent folderless subset.make preflight: 15 checks pass, including both new manifest entries./space/{id}/listembeds afolderobject per list;/space/{id}/folderembedslistsper folder).Tests
plugins/omi-clickup-app/test_clickup_client.py(new, registered asclickup-app-client-tests): drivesget_all_liststhrough a patchedrequestsseam — embedded folder lists, the per-folder fallback, a 500 on either folder endpoint failing closed to[], and a space with no folders keeping its folderless lists. Four of the five fail on the old client (onlyInboxcomes back).plugins/omi-clickup-app/test_settings_page.py(new, registered asclickup-app-settings-page-tests): renders the realroothandler with a stubbed framework — folder label, and a folder named<b>Sprint</b>in a space namedEng & Cocoming out as text. Both fail on the oldmain.py.requests/dotenv/framework imports are stubbed inside apatch.dict(sys.modules, …)scope like the sibling plugin suites, so nothing leaks into a shared test process and the files run on a stdlib-only interpreter.Failure class (fixes)
Failure-Class: none