Repository navigation
Fix WRONG_DOCUMENT_ERR in every flow.* operation on a tree-read PRD - #32
Merged
Merged
Conversation
syncDefinition clones the edited process by serialising and re-parsing it, which yields a node of a new document, then placed it in the definition's document directly. Import it first. A tree read from disk always trips this (process.xml is read separately from definition.xml); the existing tests built their PRD in one document and never did. Co-Authored-By: Claude Fable 5.1 <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.
Bug
Every
flow.*operation (flow.activity.set,flow.activity.add,flow.link.*, …) failed withon any PRD read from an as-code tree.
FlowOps.syncDefinitioncopies the edited<process>into the definition by serialising and re-parsing it, which yields a node of a brand-new document, and then placed that node in the definition's document directly. A tree read from disk always trips this (process.xmlis parsed separately fromdefinition.xml, and the definition has no<process>child); the existing flow tests built their PRD in one document and never did.Fix
Import the clone into the definition's document before placing it (
importNode). One line.Test
FlowOpsSeparateProcessTest: writes the synthetic driver set, reads it back (asserting the two documents are distinct), runsflow.activity.set --name, reads again and checks the name. Fails on master, passes here. 789 tests green.Found while building the DirXMLDevWeb PRD editor, which stages these operations.
🤖 Generated with Claude Code