Skip to content

Commit

Permalink
fix(communities)!: stop syncing community on LastOpenedAt update
Browse files Browse the repository at this point in the history
Syncing the entire community for potentially frequent actions like
`LastOpenedAt` updates is highly inefficient when using Waku as the
transport layer, as it can result in significant bandwidth overhead.
  • Loading branch information
osmaczko committed Sep 27, 2024
1 parent 38308d4 commit d6d810e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions protocol/messenger_communities.go
Original file line number Diff line number Diff line change
Expand Up @@ -934,11 +934,7 @@ func (m *Messenger) CommunityUpdateLastOpenedAt(communityID string) (int64, erro
return 0, err
}
currentTime := time.Now().Unix()
updatedCommunity, err := m.communitiesManager.CommunityUpdateLastOpenedAt(id, currentTime)
if err != nil {
return 0, err
}
err = m.syncCommunity(context.Background(), updatedCommunity, m.dispatchMessage)
_, err = m.communitiesManager.CommunityUpdateLastOpenedAt(id, currentTime)
if err != nil {
return 0, err
}
Expand Down

0 comments on commit d6d810e

Please sign in to comment.