continue process after SaveSyncDisplayName get `ErrNewClockOlderTha… (#3952)

* continue process after `SaveSyncDisplayName` get `ErrNewClockOlderThanCurrent`

* bump version
This commit is contained in:
frank 2023-08-25 22:28:26 +08:00 committed by GitHub
parent abe43a83ae
commit 3837428384
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 7 deletions

View file

@ -1 +1 @@
0.165.1
0.165.2

View file

@ -3,16 +3,15 @@ package protocol
import (
"database/sql"
ensservice "github.com/status-im/status-go/services/ens"
"github.com/status-im/status-go/protocol/identity"
v1protocol "github.com/status-im/status-go/protocol/v1"
"go.uber.org/zap"
"github.com/status-im/status-go/images"
"github.com/status-im/status-go/multiaccounts/errors"
"github.com/status-im/status-go/protocol/identity"
"github.com/status-im/status-go/protocol/protobuf"
v1protocol "github.com/status-im/status-go/protocol/v1"
"github.com/status-im/status-go/protocol/wakusync"
ensservice "github.com/status-im/status-go/services/ens"
)
const (
@ -106,12 +105,17 @@ func (m *Messenger) handleBackedUpProfile(message *protobuf.BackedUpProfile, bac
}
err := m.SaveSyncDisplayName(message.DisplayName, message.DisplayNameClock)
if err != nil {
if err != nil && err != errors.ErrNewClockOlderThanCurrent {
return err
}
response.SetDisplayName(message.DisplayName)
// if we already have a newer clock, then we don't need to update the display name
if err == errors.ErrNewClockOlderThanCurrent {
response.SetDisplayName(m.account.Name)
}
syncWithBackedUpImages := false
dbImages, err := m.multiAccounts.GetIdentityImages(message.KeyUid)
if err != nil {