diff --git a/contracts/src/v0.8/keystone/CapabilitiesRegistry.sol b/contracts/src/v0.8/keystone/CapabilitiesRegistry.sol index 56df5078672..6b150dc5d74 100644 --- a/contracts/src/v0.8/keystone/CapabilitiesRegistry.sol +++ b/contracts/src/v0.8/keystone/CapabilitiesRegistry.sol @@ -1010,10 +1010,7 @@ contract CapabilitiesRegistry is OwnerIsCreator, TypeAndVersionInterface { /// beforeCapabilityConfigSet if ( capability.configurationContract.code.length == 0 || - !IERC165(capability.configurationContract).supportsInterface( - ICapabilityConfiguration.getCapabilityConfiguration.selector ^ - ICapabilityConfiguration.beforeCapabilityConfigSet.selector - ) + !IERC165(capability.configurationContract).supportsInterface(type(ICapabilityConfiguration).interfaceId) ) revert InvalidCapabilityConfigurationContractInterface(capability.configurationContract); } s_capabilities[hashedCapabilityId] = capability; diff --git a/core/services/workflows/engine.go b/core/services/workflows/engine.go index 362fb7fb098..2692b53f5e8 100644 --- a/core/services/workflows/engine.go +++ b/core/services/workflows/engine.go @@ -355,9 +355,25 @@ func (e *Engine) registerTrigger(ctx context.Context, t *triggerCapability, trig }} } + e.wg.Add(1) go func() { - for event := range eventsCh { - e.triggerEvents <- event + defer e.wg.Done() + + for { + select { + case <-e.stopCh: + return + case event, isOpen := <-eventsCh: + if !isOpen { + return + } + + select { + case <-e.stopCh: + return + case e.triggerEvents <- event: + } + } } }()