fix(document-api): handle JSON-encoded tags in SDT query operations#3717
Open
mattConnHarbour wants to merge 2 commits into
Open
fix(document-api): handle JSON-encoded tags in SDT query operations#3717mattConnHarbour wants to merge 2 commits into
mattConnHarbour wants to merge 2 commits into
Conversation
The StructuredContent extension stores tags as JSON (e.g., `{"group":"tag"}`),
while the Document API stores them as plain strings. This caused selectByTag
and list queries to fail when searching for SDTs created via the editor.
Add matchesTag() helper that handles both formats, checking for direct string
match first, then parsing JSON to check the `group` property as fallback.
SD-3428
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
960f98b to
affabfd
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Address galley review findings: - Add 7 regression tests for JSON-encoded tag matching - Refactor matchesTag() to use canonical getGroup() helper from tagUtils.js to avoid duplicating JSON decode logic Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
matchesTag()helper to handle both plain string and JSON-encoded tag formatsselectByTagandlistqueries to find SDTs created via the StructuredContent extension{"group":"tag"}while Document API stores plain"tag"Test plan
selectByTagreturns both SDTslist({ tag: '...' })returns both SDTsFixes SD-3428
🤖 Generated with Claude Code