docs(lark-base): add known API pitfalls to skill references#266
docs(lark-base): add known API pitfalls to skill references#266flyinghanger wants to merge 4 commits intolarksuite:mainfrom
Conversation
Three gotchas verified in production that were not documented: - base-create: default table contains empty records; clean them before writing data to avoid dirty rows - field-update: updating primary field (is_primary) requires explicit `type` in JSON or API returns 99992402; select/multiselect options are fully overwritten on PUT so existing options must be included - field-create: link field is bound to one fixed table per column; different rows cannot point to different tables
|
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)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughDocumentation updates to three Lark Base reference pages: Base creation warns that creating a Base auto-generates default empty records and explains how to remove them; field-creation clarifies Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Greptile SummaryThis PR adds three production-verified API pitfalls to Confidence Score: 4/5Safe to merge after adding the missing is_primary pitfall that is described in the PR description but absent from the diff. Two of the three claimed +field-update pitfalls are correctly documented. The third — primary-field update requiring explicit type — is entirely missing from the changes, leaving a gap between what the PR claims to document and what it actually documents. skills/lark-base/references/lark-base-field-update.md is missing one of the three pitfalls described in the PR. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[+base-create] --> B[Auto-generated default table\nwith empty records]
B --> C{Need to write data?}
C -->|Yes| D[+record-list to find empty rows\n+record-delete --yes to clean up]
C -->|No| E[Proceed normally]
F[+field-create: link type] --> G[Fixed to one target table per column\nRows cannot point to different tables]
G --> H[Workaround: text field\n+ naming convention]
I[+field-update] --> J{Field type / property?}
J -->|select / multiselect| K[PUT is full overwrite\nMissing options = all options cleared]
K --> L[+field-get first, then\ninclude full options array]
J -->|is_primary: true field| M[Must include explicit 'type'\nor API returns 99992402]
M --> N[⚠️ NOT yet documented\nin this PR]
Reviews (3): Last reviewed commit: "docs(lark-base): remove redundant is_pri..." | Re-trigger Greptile |
- field-create: echo link constraint in 坑点 section (not just inline) - field-update: add inline hint (全量覆盖,漏传即清空) to select spec
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@8432a8c44ce01a3b158a260531535cc19a3e35d2🧩 Skill updatenpx skills add flyinghanger/cli#fix/lark-base-pitfalls -y -g |
|
Thank you for the contribution.
|
Per maintainer feedback: type is required for all field updates and
already covered by the existing JSON value spec ("至少显式包含 name、type"),
so the is_primary-specific bullet was redundant.
|
Thanks for the review! Replies inline:
|
Summary
Three production-verified gotchas that were not documented in the skill references:
+base-create: A newly created Base contains empty records in its default table. These should be cleaned up with+record-deletebefore writing data to avoid dirty rows.+field-update: (1) Updating the primary field (is_primary: true) requires an explicittypein the JSON payload, otherwise the API returns99992402 field validation failed. (2)select/multiselectoptions are fully overwritten on PUT — if you only intend to update the description, you must include the existingoptionsarray or all option values will be lost.+field-create: Alinkfield is bound to one fixed table per column. Different rows in the same column cannot point to different tables. Use a naming convention (e.g. a text field storing the target table name) instead.Test plan
Summary by CodeRabbit