fix(batch-add): on batch add persist subblock values#2819
Merged
icecrasher321 merged 3 commits intostagingfrom Jan 14, 2026
Merged
fix(batch-add): on batch add persist subblock values#2819icecrasher321 merged 3 commits intostagingfrom
icecrasher321 merged 3 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile SummaryThis PR fixes a bug where subblock values were not persisted to the database during batch add operations. The fix consolidates subblock merging logic into a new utility file ( Key Changes:
The change follows a clear pattern where subblock values are now properly merged at the database layer, ensuring consistency between the client state and persisted data. Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant UI as UI/Frontend
participant Hook as useCollaborativeWorkflow
participant Store as WorkflowStore
participant SubStore as SubBlockStore
participant Socket as Socket Handler
participant DB as Database Operations
participant Utils as Subblock Utils
Note over UI,Utils: Batch Add Blocks Flow
UI->>Hook: batchAddBlocks(blocks, edges, subBlockValues)
Hook->>Store: batchAddBlocks(blocks, edges, subBlockValues)
Store->>Store: Add blocks to local state
alt subBlockValues provided
Store->>SubStore: Update workflowValues with subBlockValues
end
Hook->>Socket: BATCH_ADD_BLOCKS operation
Note over Hook,Socket: payload includes subBlockValues
Socket->>DB: handleBlocksOperationTx(BATCH_ADD_BLOCKS)
loop For each block
DB->>Utils: mergeSubBlockValues(block.subBlocks, subBlockValues[blockId])
Utils-->>DB: merged subBlocks with values
end
DB->>DB: Insert blocks with merged subBlocks to database
Note over UI,Utils: Subblock values now persisted in DB
|
Collaborator
Author
|
@greptile |
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
Persist subblock values in batch add handler.
Type of Change
Testing
Tested manually
Checklist