mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 08:27:32 +00:00
feat: sequence and timestamp on searchrequests (#468)
* feat: reread events * feat: sequence and timestamo on search requests * feat: sequence and timestamo on search requests * fix: better naming * fix: log errors * fix: read sequence before search request
This commit is contained in:
@@ -2,13 +2,12 @@ package view
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/caos/zitadel/internal/view/repository"
|
||||
|
||||
"github.com/caos/zitadel/internal/errors"
|
||||
global_model "github.com/caos/zitadel/internal/model"
|
||||
proj_model "github.com/caos/zitadel/internal/project/model"
|
||||
"github.com/caos/zitadel/internal/project/repository/view"
|
||||
"github.com/caos/zitadel/internal/project/repository/view/model"
|
||||
"github.com/caos/zitadel/internal/view/repository"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -39,7 +38,7 @@ func (v *View) DeleteApplication(appID string, eventSequence uint64) error {
|
||||
return v.ProcessedApplicationSequence(eventSequence)
|
||||
}
|
||||
|
||||
func (v *View) GetLatestApplicationSequence() (uint64, error) {
|
||||
func (v *View) GetLatestApplicationSequence() (*repository.CurrentSequence, error) {
|
||||
return v.latestSequence(applicationTable)
|
||||
}
|
||||
|
||||
|
@@ -55,7 +55,7 @@ func (v *View) DeleteKeyPair(keyID string, eventSequence uint64) error {
|
||||
return v.ProcessedKeySequence(eventSequence)
|
||||
}
|
||||
|
||||
func (v *View) GetLatestKeySequence() (uint64, error) {
|
||||
func (v *View) GetLatestKeySequence() (*repository.CurrentSequence, error) {
|
||||
return v.latestSequence(keyTable)
|
||||
}
|
||||
|
||||
|
@@ -35,7 +35,7 @@ func (v *View) ProcessedOrgFailedEvent(failedEvent *repository.FailedEvent) erro
|
||||
return v.saveFailedEvent(failedEvent)
|
||||
}
|
||||
|
||||
func (v *View) GetLatestOrgSequence() (uint64, error) {
|
||||
func (v *View) GetLatestOrgSequence() (*repository.CurrentSequence, error) {
|
||||
return v.latestSequence(orgTable)
|
||||
}
|
||||
|
||||
|
@@ -12,6 +12,6 @@ func (v *View) saveCurrentSequence(viewName string, sequence uint64) error {
|
||||
return repository.SaveCurrentSequence(v.Db, sequencesTable, viewName, sequence)
|
||||
}
|
||||
|
||||
func (v *View) latestSequence(viewName string) (uint64, error) {
|
||||
func (v *View) latestSequence(viewName string) (*repository.CurrentSequence, error) {
|
||||
return repository.LatestSequence(v.Db, sequencesTable, viewName)
|
||||
}
|
||||
|
@@ -82,7 +82,7 @@ func (v *View) DeleteApplicationTokens(eventSequence uint64, ids ...string) erro
|
||||
return v.ProcessedTokenSequence(eventSequence)
|
||||
}
|
||||
|
||||
func (v *View) GetLatestTokenSequence() (uint64, error) {
|
||||
func (v *View) GetLatestTokenSequence() (*repository.CurrentSequence, error) {
|
||||
return v.latestSequence(tokenTable)
|
||||
}
|
||||
|
||||
|
@@ -58,7 +58,7 @@ func (v *View) DeleteUser(userID string, eventSequence uint64) error {
|
||||
return v.ProcessedUserSequence(eventSequence)
|
||||
}
|
||||
|
||||
func (v *View) GetLatestUserSequence() (uint64, error) {
|
||||
func (v *View) GetLatestUserSequence() (*repository.CurrentSequence, error) {
|
||||
return v.latestSequence(userTable)
|
||||
}
|
||||
|
||||
|
@@ -51,7 +51,7 @@ func (v *View) DeleteUserGrant(grantID string, eventSequence uint64) error {
|
||||
return v.ProcessedUserGrantSequence(eventSequence)
|
||||
}
|
||||
|
||||
func (v *View) GetLatestUserGrantSequence() (uint64, error) {
|
||||
func (v *View) GetLatestUserGrantSequence() (*repository.CurrentSequence, error) {
|
||||
return v.latestSequence(userGrantTable)
|
||||
}
|
||||
|
||||
|
@@ -38,7 +38,7 @@ func (v *View) DeleteUserSessions(userID string, eventSequence uint64) error {
|
||||
return v.ProcessedUserSessionSequence(eventSequence)
|
||||
}
|
||||
|
||||
func (v *View) GetLatestUserSessionSequence() (uint64, error) {
|
||||
func (v *View) GetLatestUserSessionSequence() (*repository.CurrentSequence, error) {
|
||||
return v.latestSequence(userSessionTable)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user