From 7626bf6728b2a356c64ee80ac38270461e8f99fb Mon Sep 17 00:00:00 2001 From: Halla Moore Date: Tue, 26 Jul 2016 13:59:35 -0700 Subject: [PATCH] Ignore thread labels that aren't listed in the account's labels Summary: An "important" label has been showing up for some users, rather than the usual important markers. We generally have a list of labels that are hidden, including the important label, but this list starts with the labels for the entire account. In these cases, we believe gmail stopped returning the important label for the accounts, while we still had threads marked as important. This resulted in the important label not being properly hidden. To fix this, we added a clause that ignores labels if they are not in the account's list of labels. Test Plan: Tested locally Reviewers: annie, bengotow Reviewed By: bengotow Differential Revision: https://phab.nylas.com/D3123 --- src/components/mail-label-set.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/mail-label-set.jsx b/src/components/mail-label-set.jsx index b5547e4d8..6ad0a7319 100644 --- a/src/components/mail-label-set.jsx +++ b/src/components/mail-label-set.jsx @@ -43,7 +43,9 @@ export default class MailLabelSet extends React.Component { const ignoredNames = MessageStore.CategoryNamesHiddenByDefault; for (const label of thread.sortedCategories()) { - if (ignoredNames.includes(label.name) || ignoredIds.includes(label.id)) { + const labelExists = CategoryStore.byId(thread.accountId, label.id); + if (ignoredNames.includes(label.name) || ignoredIds.includes(label.id) || + !labelExists) { continue; }