fix(GODT-2327): Clear update channels whenever clearing sync status

This commit is contained in:
James Houlahan
2023-02-06 10:54:01 +01:00
committed by Jakub
parent d7cac8a8f0
commit ab1c1c474a
2 changed files with 19 additions and 15 deletions

View File

@ -113,11 +113,8 @@ func (user *User) handleRefreshEvent(ctx context.Context, refresh proton.Refresh
user.apiAddrs = groupBy(apiAddrs, func(addr proton.Address) string { return addr.ID })
user.apiLabels = groupBy(apiLabels, func(label proton.Label) string { return label.ID })
// Reinitialize the update channels.
user.initUpdateCh(user.vault.AddressMode())
// Clear sync status; we want to sync everything again.
if err := user.vault.ClearSyncStatus(); err != nil {
if err := user.clearSyncStatus(); err != nil {
return fmt.Errorf("failed to clear sync status: %w", err)
}