1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-08 05:57:03 +09:00

Merge pull request #441 from anyproto/GO-5520-fix-divergent-hash

GO-5520: Add legacy hash key to state storage
This commit is contained in:
Mikhail Rakhmanov 2025-04-24 16:51:48 +02:00 committed by GitHub
commit ef98550e9e
Signed by: github
GPG key ID: B5690EEEBB952194

View file

@ -11,6 +11,7 @@ import (
type State struct {
OldHash string
NewHash string
LegacyHash string
AclId string
SettingsId string
SpaceId string
@ -33,6 +34,7 @@ const (
idKey = "id"
oldHashKey = "oh"
newHashKey = "nh"
legacyHashKey = "h"
headerKey = "e"
aclIdKey = "a"
settingsIdKey = "s"
@ -151,6 +153,7 @@ func (s *stateStorage) stateFromDoc(doc anystore.Doc) State {
AclId: doc.Value().GetString(aclIdKey),
OldHash: doc.Value().GetString(newHashKey),
NewHash: doc.Value().GetString(oldHashKey),
LegacyHash: doc.Value().GetString(legacyHashKey),
SpaceHeader: doc.Value().GetBytes(headerKey),
}
}