-
Notifications
You must be signed in to change notification settings - Fork 0
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
Reuse incident state from the database #43
Conversation
Looks like required state from other tables isn't read back yet:
|
276e65f
to
1a938d6
Compare
95a1c31
to
8636418
Compare
28cb077
to
4f4f7ed
Compare
37d26e5
to
4729fc2
Compare
internal/listener/listener.go
Outdated
rk := incident.RecipientKey{ContactID: escalationRecipient.ContactID, GroupID: escalationRecipient.GroupID} | ||
for recipientKey, state := range currentIncident.Recipients { | ||
if recipientKey == rk { | ||
state.Channels[escalationRecipient.ChannelType] = struct{}{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyways, the goal is to always derive the current set of channels per recipient from the config based on which escalations have triggered so far. So please remove the Channels
from RecipientState
altogether (if it's not there, it can't get inconsistent).
740c636
to
6f538d1
Compare
6f538d1
to
68a76ed
Compare
68a76ed
to
2cedcb1
Compare
2cedcb1
to
129ffb0
Compare
Has a merge conflict after merging #42. |
129ffb0
to
c6bc865
Compare
fixes #38