mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-07 15:22:32 +00:00
fix: handle sequence correctly in subscription (#1209)
This commit is contained in:
@@ -51,8 +51,8 @@ func (v *View) DeleteApplication(appID string, event *models.Event) error {
|
||||
return v.ProcessedApplicationSequence(event)
|
||||
}
|
||||
|
||||
func (v *View) GetLatestApplicationSequence(aggregateType string) (*repository.CurrentSequence, error) {
|
||||
return v.latestSequence(applicationTable, aggregateType)
|
||||
func (v *View) GetLatestApplicationSequence() (*repository.CurrentSequence, error) {
|
||||
return v.latestSequence(applicationTable)
|
||||
}
|
||||
|
||||
func (v *View) ProcessedApplicationSequence(event *models.Event) error {
|
||||
|
||||
@@ -36,8 +36,8 @@ func (v *View) ProcessedOrgFailedEvent(failedEvent *repository.FailedEvent) erro
|
||||
return v.saveFailedEvent(failedEvent)
|
||||
}
|
||||
|
||||
func (v *View) GetLatestOrgSequence(aggregateType string) (*repository.CurrentSequence, error) {
|
||||
return v.latestSequence(orgTable, aggregateType)
|
||||
func (v *View) GetLatestOrgSequence() (*repository.CurrentSequence, error) {
|
||||
return v.latestSequence(orgTable)
|
||||
}
|
||||
|
||||
func (v *View) ProcessedOrgSequence(event *models.Event) error {
|
||||
|
||||
@@ -12,15 +12,15 @@ const (
|
||||
)
|
||||
|
||||
func (v *View) saveCurrentSequence(viewName string, event *models.Event) error {
|
||||
return repository.SaveCurrentSequence(v.Db, sequencesTable, viewName, string(event.AggregateType), event.Sequence, event.CreationDate)
|
||||
return repository.SaveCurrentSequence(v.Db, sequencesTable, viewName, event.Sequence, event.CreationDate)
|
||||
}
|
||||
|
||||
func (v *View) latestSequence(viewName, aggregateType string) (*repository.CurrentSequence, error) {
|
||||
return repository.LatestSequence(v.Db, sequencesTable, viewName, aggregateType)
|
||||
func (v *View) latestSequence(viewName string) (*repository.CurrentSequence, error) {
|
||||
return repository.LatestSequence(v.Db, sequencesTable, viewName)
|
||||
}
|
||||
|
||||
func (v *View) updateSpoolerRunSequence(viewName string) error {
|
||||
currentSequence, err := repository.LatestSequence(v.Db, sequencesTable, viewName, "")
|
||||
currentSequence, err := repository.LatestSequence(v.Db, sequencesTable, viewName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -40,8 +40,8 @@ func (v *View) DeleteSessionTokens(agentID, userID string, event *models.Event)
|
||||
return v.ProcessedTokenSequence(event)
|
||||
}
|
||||
|
||||
func (v *View) GetLatestTokenSequence(aggregateType string) (*repository.CurrentSequence, error) {
|
||||
return v.latestSequence(tokenTable, aggregateType)
|
||||
func (v *View) GetLatestTokenSequence() (*repository.CurrentSequence, error) {
|
||||
return v.latestSequence(tokenTable)
|
||||
}
|
||||
|
||||
func (v *View) ProcessedTokenSequence(event *models.Event) error {
|
||||
|
||||
@@ -49,8 +49,8 @@ func (v *View) DeleteUserGrant(grantID string, event *models.Event) error {
|
||||
return v.ProcessedUserGrantSequence(event)
|
||||
}
|
||||
|
||||
func (v *View) GetLatestUserGrantSequence(aggregateType string) (*repository.CurrentSequence, error) {
|
||||
return v.latestSequence(userGrantTable, aggregateType)
|
||||
func (v *View) GetLatestUserGrantSequence() (*repository.CurrentSequence, error) {
|
||||
return v.latestSequence(userGrantTable)
|
||||
}
|
||||
|
||||
func (v *View) ProcessedUserGrantSequence(event *models.Event) error {
|
||||
|
||||
Reference in New Issue
Block a user