fix: parsing empty whiteboard#1391
Conversation
|
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 (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughRemoves explicit error on missing ChangesWhiteboard nodes field validation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
shortcuts/whiteboard/whiteboard_query.go (1)
187-194:⚠️ Potential issue | 🔴 CriticalFix
TestFetchWhiteboardNodes_InvalidResponseTypedErrorfor the “missing nodes” case
fetchWhiteboardNodesnow treats absentdata.nodesas an empty board (returns&wbNodesResp{}withData.Nodes == nil), since it only validatesdata.nodeswhen present.shortcuts/whiteboard/whiteboard_query_test.gostill has a"missing nodes"case (data: map[string]interface{}{}) that callsassertInvalidResponse(t, err)and expectserrs.SubtypeInvalidResponse, so it will fail.- Update the
"missing nodes"test to expect success/empty handling (consistent with the existing empty-board shortcut tests).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@shortcuts/whiteboard/whiteboard_query.go` around lines 187 - 194, Update the test case inside TestFetchWhiteboardNodes_InvalidResponseTypedError for the "missing nodes" scenario to expect success/empty handling instead of an invalid-response error: call fetchWhiteboardNodes and assert it returns a nil error (or success) and a &wbNodesResp{}-like response where Data.Nodes == nil (i.e., treat absent data["nodes"] as an empty board), replacing the current assertInvalidResponse/errs.SubtypeInvalidResponse expectation.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@shortcuts/whiteboard/whiteboard_query.go`:
- Around line 187-194: Update the test case inside
TestFetchWhiteboardNodes_InvalidResponseTypedError for the "missing nodes"
scenario to expect success/empty handling instead of an invalid-response error:
call fetchWhiteboardNodes and assert it returns a nil error (or success) and a
&wbNodesResp{}-like response where Data.Nodes == nil (i.e., treat absent
data["nodes"] as an empty board), replacing the current
assertInvalidResponse/errs.SubtypeInvalidResponse expectation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3342ea67-be83-42fa-a74f-1551370aa6fc
📒 Files selected for processing (1)
shortcuts/whiteboard/whiteboard_query.go
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@cc26d6781e16e22f97eec63cdeaffa674db4856f🧩 Skill updatenpx skills add larksuite/cli#fix/query_empty_whiteboard -y -g |
Change-Id: I10082f89c36ed77e77e1d016be263e0f7369b7b3
4b39b03 to
cc26d67
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1391 +/- ##
==========================================
- Coverage 72.74% 72.74% -0.01%
==========================================
Files 730 730
Lines 69031 69029 -2
==========================================
- Hits 50220 50218 -2
Misses 15037 15037
Partials 3774 3774 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Fixed a minor problem inrtoduced in PR#1236(#1236) that causing querying empty whiteboard emiting errors.
Summary by CodeRabbit
Refactor
Bug Fixes
Tests