fix(task): always send completed filter in +get-my-tasks#172
fix(task): always send completed filter in +get-my-tasks#172VedantMadane wants to merge 1 commit intolarksuite:mainfrom
Conversation
When --complete is omitted, the completed query parameter was not sent to the API, causing it to return all tasks (completed + incomplete) instead of defaulting to incomplete-only as documented. Always send completed=false when the flag is unset so the behavior matches the help text. Fixes larksuite#164
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughModified Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
|
Greptile SummaryThis PR fixes a bug where The fix removes the Key changes:
Confidence Score: 5/5Safe to merge — the change is minimal, well-scoped, and correctly aligns runtime behaviour with documented defaults. The fix is a straightforward removal of a conditional guard that was causing the documented default to be silently ignored. Both changed paths (Execute and DryRun) are handled consistently. There are no new dependencies, no schema changes, and no risk of regressions beyond the intentional behaviour change (incomplete-only by default). All remaining observations are P2 or lower, so the score is 5. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant CLI
participant LarkAPI
Note over User,LarkAPI: Before fix (--complete omitted)
User->>CLI: lark-cli task +get-my-tasks
CLI->>LarkAPI: GET /open-apis/task/v2/tasks?type=my_tasks&user_id_type=open_id&page_size=50
LarkAPI-->>CLI: all tasks (completed + incomplete)
Note over User,LarkAPI: After fix (--complete omitted)
User->>CLI: lark-cli task +get-my-tasks
CLI->>LarkAPI: GET /open-apis/task/v2/tasks?type=my_tasks&user_id_type=open_id&page_size=50&completed=false
LarkAPI-->>CLI: incomplete tasks only
Note over User,LarkAPI: After fix (--complete=true)
User->>CLI: lark-cli task +get-my-tasks --complete=true
CLI->>LarkAPI: GET /open-apis/task/v2/tasks?type=my_tasks&user_id_type=open_id&page_size=50&completed=true
LarkAPI-->>CLI: completed tasks only
Reviews (1): Last reviewed commit: "fix(task): always send completed filter ..." | Re-trigger Greptile |
Fixes #164
Problem
lark-cli task +get-my-tasksreturns both completed and incomplete tasks when--completeis omitted. The help text saysdefault is false, but the code only sends thecompletedquery parameter when--completeis explicitly passed. When omitted, no filter is sent and the API returns everything.Fix
Always send the
completedparameter using the flag's value. Since Go's bool zero value isfalse, omitting--completenow sendscompleted=falseto the API, matching the documented behavior.Before (11 lines):
After (1 line):
Same fix applied to both
ExecuteandDryRunfunctions.Summary by CodeRabbit
Bug Fixes
Refactor