From 4cf23bb2e6cf815bcabec071c6013c7b92fe9120 Mon Sep 17 00:00:00 2001 From: James Houlahan Date: Thu, 2 Feb 2023 16:25:27 +0100 Subject: [PATCH] fix(GODT-2328): Ignore labels that aren't part of user label set --- Changelog.md | 1 + internal/user/sync.go | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 3ab3e8b0..81ebc33f 100644 --- a/Changelog.md +++ b/Changelog.md @@ -5,6 +5,7 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/) ## [Bridge 3.0.13] Perth Narrows ### Fixed +GODT-2328: Ignore labels that aren't part of user label set. GODT-2326: Sync issue on missing fresh DB file. GODT-2319: Seed the math/rand RNG on app startup. GODT-1804: Preserve MIME parameters when uploading attachments. diff --git a/internal/user/sync.go b/internal/user/sync.go index 6e4faeea..a7c25c0f 100644 --- a/internal/user/sync.go +++ b/internal/user/sync.go @@ -463,6 +463,11 @@ func wantLabel(label proton.Label) bool { func wantLabels(apiLabels map[string]proton.Label, labelIDs []string) []string { return xslices.Filter(labelIDs, func(labelID string) bool { - return wantLabel(apiLabels[labelID]) + apiLabel, ok := apiLabels[labelID] + if !ok { + return false + } + + return wantLabel(apiLabel) }) }