← Back to PRs

#16409: fix(feishu): preserve docx block order via sequential inserts

by ciberponk open 2026-02-14 18:41 View on GitHub →
channel: feishu size: S
## Summary - fix(feishu): preserve docx block order via sequential inserts - Split from our `v2026.2.13` patch train as a single-purpose change for easier review. ## Why - Keep the diff focused and low-risk so it can be merged or reverted independently. ## Scope - Branch: `fix/feishu-docx-sequential-insert-v2026-2-13-en` - Files changed: 2 - Key files: - `extensions/feishu/src/docx.test.ts` - `extensions/feishu/src/docx.ts` ## Test Plan - Suggested local command: - `./node_modules/.bin/vitest run extensions/feishu/src/docx.test.ts` - Validation status: - [ ] CI checks pass - [ ] Maintainer re-ran local tests ## Risk & Rollback - Risk: low to medium; impact limited to touched module(s). - Rollback: revert this PR commit(s) cleanly. ## Co-authorship - Co-authored by @ciberponk and Codex (GPT-5). <!-- greptile_comment --> <h3>Greptile Summary</h3> Changed `insertBlocks` to insert blocks one-at-a-time sequentially instead of in a single batch, ensuring markdown conversion order is preserved in the final Feishu document. Previously, batch insertion via `documentBlockChildren.create` with multiple children could reorder blocks unpredictably. Added a test that verifies each block is inserted individually in the correct sequence. <h3>Confidence Score: 4/5</h3> - Safe to merge with minimal risk - focused fix for a specific ordering issue - The change is straightforward and well-tested. It trades performance (N API calls vs 1) for correctness, which is appropriate for this use case. The test coverage validates the sequential behavior. Minor risk exists around partial failure handling - if an insert fails mid-sequence, earlier blocks remain inserted with no rollback, but this matches the existing error-handling pattern. - No files require special attention <sub>Last reviewed commit: a43a2f9</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs