fix: pubsub (#1122)

* start sub

* start implement subsciptions

* start subscription

* implementation for member done

* admin done

* fix: tests

* extend handlers

* prepary notification

* no errors in adminapi

* changed current sequence in all packages

* ignore mocks

* works

* subscriptions as singleton

* tests

* refactor: rename function scope var

* fix: process ALL previous sequences

* fix: spooler and pubsub

* handler check

* fix: process events until all done

* fix break on query err

* fix: handler

* fix: process sequence or return error

* check aggregate id

* fix: log only in error case

* fix tests

* fix: handlers

* fix: spooler

* fix: spooler

* fix: tests

* fix: continue

Co-authored-by: Livio Amstutz <[email protected]>
This commit is contained in:
Silvan
2020-12-21 18:42:34 +01:00
committed by GitHub
co-authored by Livio Amstutz
parent dd5e4acd24
commit 3118a99c1e
49 changed files with 256 additions and 193 deletions
@@ -2,7 +2,6 @@ package handler
import (
"github.com/caos/logging"
"github.com/caos/zitadel/internal/eventstore"
"github.com/caos/zitadel/internal/eventstore/models"
es_models "github.com/caos/zitadel/internal/eventstore/models"
@@ -93,7 +92,10 @@ func (p *ProjectRole) Reduce(event *es_models.Event) (err error) {
}
return p.view.DeleteProjectRole(event.AggregateID, event.ResourceOwner, role.Key, event)
case model.ProjectRemoved:
return p.view.DeleteProjectRolesByProjectID(event.AggregateID)
err := p.view.DeleteProjectRolesByProjectID(event.AggregateID)
if err == nil {
return p.view.ProcessedProjectRoleSequence(event)
}
default:
return p.view.ProcessedProjectRoleSequence(event)
}