diff --git a/protocol/communities_messenger_test.go b/protocol/communities_messenger_test.go index c576d5394..21cb60f95 100644 --- a/protocol/communities_messenger_test.go +++ b/protocol/communities_messenger_test.go @@ -4120,54 +4120,6 @@ func (s *MessengerCommunitiesSuite) TestCommunityLastOpenedAt() { s.Require().True(lastOpenedAt2 > lastOpenedAt1) } -func (s *MessengerCommunitiesSuite) TestSyncCommunityLastOpenedAt() { - // Create new device - alicesOtherDevice := s.createOtherDevice(s.alice) - PairDevices(&s.Suite, alicesOtherDevice, s.alice) - - // Create a community - createCommunityReq := &requests.CreateCommunity{ - Membership: protobuf.CommunityPermissions_MANUAL_ACCEPT, - Name: "new community", - Color: "#000000", - Description: "new community description", - } - - mr, err := s.alice.CreateCommunity(createCommunityReq, true) - s.Require().NoError(err, "s.alice.CreateCommunity") - var newCommunity *communities.Community - for _, com := range mr.Communities() { - if com.Name() == createCommunityReq.Name { - newCommunity = com - } - } - s.Require().NotNil(newCommunity) - - // Mock frontend triggering communityUpdateLastOpenedAt - lastOpenedAt, err := s.alice.CommunityUpdateLastOpenedAt(newCommunity.IDString()) - s.Require().NoError(err) - - // Check lastOpenedAt was updated - s.Require().True(lastOpenedAt > 0) - - err = tt.RetryWithBackOff(func() error { - _, err = alicesOtherDevice.RetrieveAll() - if err != nil { - return err - } - // Do we have a new synced community? - _, err := alicesOtherDevice.communitiesManager.GetSyncedRawCommunity(newCommunity.ID()) - if err != nil { - return fmt.Errorf("community with sync not received %w", err) - } - - return nil - }) - otherDeviceCommunity, err := alicesOtherDevice.communitiesManager.GetByID(newCommunity.ID()) - s.Require().NoError(err) - s.Require().True(otherDeviceCommunity.LastOpenedAt() > 0) -} - func (s *MessengerCommunitiesSuite) TestBanUserAndDeleteAllUserMessages() { community, _ := s.createCommunity() diff --git a/protocol/messenger_communities.go b/protocol/messenger_communities.go index 0784f7e5d..e5c75b451 100644 --- a/protocol/messenger_communities.go +++ b/protocol/messenger_communities.go @@ -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 }