mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:37:32 +00:00
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 <livio.a@gmail.com>
This commit is contained in:
@@ -111,8 +111,6 @@ func (n *Notification) Reduce(event *models.Event) (err error) {
|
||||
err = n.handlePasswordCode(event)
|
||||
case es_model.DomainClaimed:
|
||||
err = n.handleDomainClaimed(event)
|
||||
default:
|
||||
return n.view.ProcessedNotificationSequence(event)
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/caos/zitadel/internal/errors"
|
||||
"github.com/caos/zitadel/internal/eventstore/models"
|
||||
"github.com/caos/zitadel/internal/user/repository/view"
|
||||
"github.com/caos/zitadel/internal/user/repository/view/model"
|
||||
@@ -20,10 +21,7 @@ func (v *View) PutNotifyUser(user *model.NotifyUser, event *models.Event) error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if event.Sequence != 0 {
|
||||
return v.ProcessedNotifyUserSequence(event)
|
||||
}
|
||||
return nil
|
||||
return v.ProcessedNotifyUserSequence(event)
|
||||
}
|
||||
|
||||
func (v *View) NotifyUsersByOrgID(orgID string) ([]*model.NotifyUser, error) {
|
||||
@@ -32,8 +30,8 @@ func (v *View) NotifyUsersByOrgID(orgID string) ([]*model.NotifyUser, error) {
|
||||
|
||||
func (v *View) DeleteNotifyUser(userID string, event *models.Event) error {
|
||||
err := view.DeleteNotifyUser(v.Db, notifyUserTable, userID)
|
||||
if err != nil {
|
||||
return nil
|
||||
if err != nil && !errors.IsNotFound(err) {
|
||||
return err
|
||||
}
|
||||
return v.ProcessedNotifyUserSequence(event)
|
||||
}
|
||||
|
@@ -24,6 +24,8 @@ func (data *TemplateData) Translate(i18n *i18n.Translator, args map[string]inter
|
||||
data.Subject = i18n.Localize(data.Subject, nil, langs...)
|
||||
data.Greeting = i18n.Localize(data.Greeting, args, langs...)
|
||||
data.Text = html.UnescapeString(i18n.Localize(data.Text, args, langs...))
|
||||
data.Href = i18n.Localize(data.Href, nil, langs...)
|
||||
if data.Href != "" {
|
||||
data.Href = i18n.Localize(data.Href, nil, langs...)
|
||||
}
|
||||
data.ButtonText = i18n.Localize(data.ButtonText, nil, langs...)
|
||||
}
|
||||
|
Reference in New Issue
Block a user