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:
parent
701251d0fb
commit
6e962f321f
1 changed files with 13 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue