Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Management new #705

Draft
wants to merge 66 commits into
base: master
Choose a base branch
from
Draft

Management new #705

wants to merge 66 commits into from

Conversation

woksin
Copy link
Contributor

@woksin woksin commented Jul 8, 2022

Summary

Summary of the PR here. The GitHub release description is created from this comment so keep it nice and descriptive.

Remember to remove sections that you don't need or use.

Added

  • Describe the added features

Changed

  • Describe the outwards facing code change

Fixed

  • Describe the fix and the bug

Removed

  • Describe what was removed and why

Security

  • Describe the security issue and the fix

Deprecated

  • Describe the part of the code being deprecated and why

einari and others added 30 commits June 1, 2021 18:22
…lled outside + simplifications.

Co-authored-by: Jakob Høgenes <[email protected]>
Purpose is for showing in WebAPI, GraphQL, UI
einari and others added 25 commits June 6, 2021 12:35
The EventHandlers is now responsible for the registration.
Right now it delegates it to the EventHandler itself.
I think we should move the actual registration into EventHandlers.
That would make the responsibility even clearer.
@woksin woksin added the minor label Jul 8, 2022
Comment on lines 147 to 163

async Task ValidateFilter()
{
_logger.ValidatingFilter(FilterDefinition.TargetStream);
var filterValidationResults = await _filterValidator.Validate(GetFilterProcessor, _cancellationTokenSource.Token).ConfigureAwait(false);

if (filterValidationResults.Any(_ => !_.Value.Succeeded))
{
var firstFailedValidation = filterValidationResults.First(_ => !_.Value.Succeeded).Value;
_logger.FilterValidationFailed(FilterDefinition.TargetStream, firstFailedValidation.FailureReason);
throw new FilterValidationFailed(FilterDefinition.TargetStream, firstFailedValidation.FailureReason);
}

var filteredStreamDefinition = new StreamDefinition(FilterDefinition);
_logger.PersistingStreamDefinition(filteredStreamDefinition.StreamId);
await _streamDefinitions.Persist(Scope, filteredStreamDefinition, _cancellationTokenSource.Token).ConfigureAwait(false);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
async Task ValidateFilter()
{
_logger.ValidatingFilter(FilterDefinition.TargetStream);
var filterValidationResults = await _filterValidator.Validate(GetFilterProcessor, _cancellationTokenSource.Token).ConfigureAwait(false);
if (filterValidationResults.Any(_ => !_.Value.Succeeded))
{
var firstFailedValidation = filterValidationResults.First(_ => !_.Value.Succeeded).Value;
_logger.FilterValidationFailed(FilterDefinition.TargetStream, firstFailedValidation.FailureReason);
throw new FilterValidationFailed(FilterDefinition.TargetStream, firstFailedValidation.FailureReason);
}
var filteredStreamDefinition = new StreamDefinition(FilterDefinition);
_logger.PersistingStreamDefinition(filteredStreamDefinition.StreamId);
await _streamDefinitions.Persist(Scope, filteredStreamDefinition, _cancellationTokenSource.Token).ConfigureAwait(false);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants