MCPcopy Index your code
hub / github.com/simstudioai/sim / acceptDiff

Method acceptDiff

apps/sim/lib/workflows/diff/diff-engine.ts:759–782  ·  view source on GitHub ↗

* Accept the diff and return the clean state

()

Source from the content-addressed store, hash-verified

757 * Accept the diff and return the clean state
758 */
759 acceptDiff(): WorkflowState | null {
760 if (!this.currentDiff) {
761 logger.warn('No diff to accept')
762 return null
763 }
764
765 try {
766 // Clean up the proposed state by removing diff markers
767 const cleanState = stripWorkflowDiffMarkers(this.currentDiff.proposedState)
768
769 logger.info('Diff accepted', {
770 blocksCount: Object.keys(cleanState.blocks).length,
771 edgesCount: cleanState.edges.length,
772 loopsCount: Object.keys(cleanState.loops).length,
773 parallelsCount: Object.keys(cleanState.parallels).length,
774 })
775
776 this.clearDiff()
777 return cleanState
778 } catch (error) {
779 logger.error('Failed to accept diff:', error)
780 return null
781 }
782 }
783}
784
785/**

Callers

nothing calls this directly

Calls 5

clearDiffMethod · 0.95
stripWorkflowDiffMarkersFunction · 0.85
infoMethod · 0.80
errorMethod · 0.80
warnMethod · 0.65

Tested by

no test coverage detected