1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-07 21:37:04 +09:00

GO-5678: Chat: push empty change to force chat to be pushed to nodes

This commit is contained in:
Sergey 2025-05-22 15:48:47 +02:00
parent 701251d0fb
commit 6e962f321f
No known key found for this signature in database
GPG key ID: 3B6BEF79160221C6

View file

@ -165,6 +165,19 @@ func (s *storeObject) Init(ctx *smartblock.InitContext) error {
s.seenHeadsCollector = newTreeSeenHeadsCollector(s.Tree())
// Push empty change to force chat object to be pushed to any-sync nodes
// Without that there can be situation when joined users can't use the chat, because it exists only in owner's local data
if ctx.IsNewObject {
_, err := s.storeSource.PushStoreChange(ctx.Ctx, source.PushStoreChangeParams{
Changes: nil,
State: s.store,
Time: time.Now(),
})
if err != nil {
return fmt.Errorf("push initial change: %w", err)
}
}
return nil
}