mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-29 13:06:44 +00:00
fix: missing messages after changing primary address
This commit is contained in:
@ -46,6 +46,8 @@ func (store *Store) RebuildMailboxes() (err error) {
|
||||
|
||||
log.WithField("user", store.UserID()).Trace("Truncating mailboxes")
|
||||
|
||||
store.addresses = nil
|
||||
|
||||
if err = store.truncateMailboxesBucket(); err != nil {
|
||||
log.WithError(err).Error("Could not truncate mailboxes bucket")
|
||||
return
|
||||
@ -127,7 +129,12 @@ func (store *Store) createOrDeleteAddressesEvent() (err error) {
|
||||
delete(store.addresses, addr.addressID)
|
||||
}
|
||||
|
||||
return err
|
||||
if err = store.truncateMailboxesBucket(); err != nil {
|
||||
log.WithError(err).Error("Could not truncate mailboxes bucket")
|
||||
return
|
||||
}
|
||||
|
||||
return store.initMailboxesBucket()
|
||||
}
|
||||
|
||||
// truncateAddressInfoBucket removes the address info bucket.
|
||||
@ -153,8 +160,6 @@ func (store *Store) truncateAddressInfoBucket() (err error) {
|
||||
func (store *Store) truncateMailboxesBucket() (err error) {
|
||||
log.Trace("Truncating mailboxes bucket")
|
||||
|
||||
store.addresses = nil
|
||||
|
||||
tx := func(tx *bolt.Tx) (err error) {
|
||||
mbs := tx.Bucket(mailboxesBucket)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user