mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-19 00:27:06 +00:00
GODT-2223: Ensure apiLabels map is properly up to date
This commit is contained in:
committed by
Leander Beernaert
parent
c8925cd270
commit
59745e6fb6
@ -366,7 +366,10 @@ func (user *User) handleUpdateLabelEvent(ctx context.Context, event proton.Label
|
||||
"name": logging.Sensitive(event.Label.Name),
|
||||
}).Info("Handling label updated event")
|
||||
|
||||
user.apiLabels[event.Label.ID] = event.Label
|
||||
// Only update the label if it exists; we don't want to create it as a client may have just deleted it.
|
||||
if _, ok := user.apiLabels[event.Label.ID]; ok {
|
||||
user.apiLabels[event.Label.ID] = event.Label
|
||||
}
|
||||
|
||||
for _, updateCh := range xslices.Unique(maps.Values(user.updateCh)) {
|
||||
update := imap.NewMailboxUpdated(
|
||||
|
||||
Reference in New Issue
Block a user