Fix RemoveDataItem on nested paths without context and PostData for object types#625
Draft
Fix RemoveDataItem on nested paths without context and PostData for object types#625
Conversation
6 tasks
…ests Agent-Logs-Url: https://github.com/spadrapo/drapo/sessions/fc3eb0b2-16fa-4107-beb6-bfbde88bcf80 Co-authored-by: silvath <2657156+silvath@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for complex nested objects in data functions
Fix RemoveDataItem on nested paths without context and PostData for object types
Apr 5, 2026
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.
Drapo's data manipulation functions broke down when used with complex nested objects as a single source of truth:
RemoveDataItemsilently failed on nested array paths without ad-forcontext, andPostDatawrapped object-type data in{Entities: ...}instead of posting the raw object graph.Changes
DrapoFunctionHandler.ts—ExecuteFunctionRemoveDataItemcontextItemisnulland the source is a nested mustache path (mustacheParts.length > 1, e.g.{{workflowprocess.Items}}), now resolves the item viaResolveItemDataPathObjectand callsDeleteDataItemwith the full pathDeleteDataItemArrayunconditionally, which iteratesdataItem.Data.length—undefinedfor an object type — so the loop never ran and the deletion silently returnedfalseRemoveDataItem({{values}}, 4)) are unaffectedDrapoStorage.ts—PostDatadataItem.Datadirectly instead of{Entities: dataItem.Data}{Entities: [...]}and UnitOfWork items post{Inserted/Updated/Deleted}as beforePostDatawithPostDataItemsemantics for object typesTests Added
FunctionRemoveDataItemMustacheWithoutContext— startup adds an item without cloning (preserving reference), button click removes it via nested path without context; validates [John, Mary, Thiago] after removalFunctionPostDataObjectNested— round-trips a nested object (Code,Name,Items[]) through a newSetFunctionPostDataObjectNestedendpoint; validates the server receives and mutates the raw object