* Accept the diff and return the clean state
()
| 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 | /** |
nothing calls this directly
no test coverage detected