Skip to content

🐛 fix(import): preserve @meta: keys during JSON chunking#51

Merged
david-vaclavek merged 1 commit intomainfrom
LOC-3978_fix_meta_key_chunking
Mar 26, 2026
Merged

🐛 fix(import): preserve @meta: keys during JSON chunking#51
david-vaclavek merged 1 commit intomainfrom
LOC-3978_fix_meta_key_chunking

Conversation

@david-vaclavek
Copy link
Copy Markdown
Contributor

@david-vaclavek david-vaclavek commented Mar 26, 2026

Summary

  • Bug: @meta: entries with object values (e.g. { "limit": 80 }) were being recursed into by sliceByValue, causing the @meta: key to be split on dots during path reconstruction with lodash setWith
  • Impact: Character limits (and other metadata like comments, add/remove) set via @meta: keys were silently lost when the key contained dots (e.g. Strapi-style keys like api::article.article[doc1].description)
  • Fix: Added !key.startsWith('@meta:') check to treat @meta: entries as leaf values instead of recursing into them

Test plan

  • Import JSON with @meta: entries containing dotted keys and verify limits are preserved
  • Verify chunking still works correctly for large imports with @meta: entries
  • Verify regular nested object keys are still correctly split/chunked

🤖 Generated with Claude Code

`sliceByValue` was recursing into `@meta:` entry values (e.g.
`{ "limit": 80 }`) because they are plain objects. This caused the
`@meta:` key to be split on dots during path reconstruction with
`setWith`, destroying the flat key structure and making the server
unable to match metadata to content keys.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 93.89% 277 / 295
🔵 Statements 93.85% 290 / 309
🔵 Functions 94.73% 72 / 76
🔵 Branches 76% 76 / 100
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/utils/json-utils.ts 85.71% 66.66% 100% 84.61% 47-48
Generated in workflow #85 for commit 6c9d2ee by the Vitest Coverage Report Action

@david-vaclavek david-vaclavek merged commit 624378b into main Mar 26, 2026
3 checks passed
@david-vaclavek david-vaclavek deleted the LOC-3978_fix_meta_key_chunking branch March 26, 2026 13:32
@localazy-bot localazy-bot bot mentioned this pull request Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants