fix(vars): add socket persistence when variable names are changed, update variable name normalization to match block name normalization, added space constraint on envvar names#2508
Conversation
…date variable name normalization to match block name normalization, added space constraint on envvar names
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR addresses three related issues around variable and block name handling:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant VariablesStore
participant SubBlockStore
participant OperationQueue
participant Socket
User->>VariablesStore: updateVariable(id, {name: newName})
VariablesStore->>VariablesStore: normalizeName(oldName)
VariablesStore->>VariablesStore: normalizeName(newName)
VariablesStore->>SubBlockStore: Get workflowValues
loop For each subblock value
VariablesStore->>VariablesStore: updateReferences(value, regex)
end
VariablesStore->>SubBlockStore: setState(updatedWorkflowValues)
loop For each changed subblock
VariablesStore->>OperationQueue: addToQueue(subblock-update)
OperationQueue->>Socket: emitSubblockUpdate()
end
Socket-->>OperationQueue: confirm operation
OperationQueue->>OperationQueue: processNextOperation()
|
There was a problem hiding this comment.
Additional Comments (2)
-
apps/sim/stores/panel/variables/store.ts, line 202-221 (link)style: the
updateReferencesfunction is defined inside the forEach loop but only depends on its parameters - consider moving it outside the loop for better performanceNote: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
apps/sim/stores/workflows/utils.ts, line 160-224 (link)logic: Missing orphaned values handling that exists in
mergeSubblockState. This could cause data loss for runtime subblock IDs like webhookId, triggerPath when using the async versionShould the async version include the same orphaned values handling (lines 125-137) as the synchronous version?
11 files reviewed, 2 comments
|
@greptile |
Summary
Type of Change
Testing
Tested manually, added unit tests
Checklist