From 19b862f26841a0fad1de268d27077b3fa4734b35 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Mon, 16 Dec 2024 11:28:07 -0500 Subject: [PATCH] fix(curated): fix crash when loading curated communities (#16971) Fixes #16967 I cannot confirm for sure if the crash is fixed. However, using the trace from the crash, I removed the function that caused the crash, since it's not useful, and since then, I couldn't reproduce the issue. The problem is that the issue was not that easily reproducible. --- src/app/modules/main/communities/controller.nim | 3 --- src/app_service/service/community/service.nim | 5 +---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/app/modules/main/communities/controller.nim b/src/app/modules/main/communities/controller.nim index 598331fc82..7255a9982c 100644 --- a/src/app/modules/main/communities/controller.nim +++ b/src/app/modules/main/communities/controller.nim @@ -226,9 +226,6 @@ proc isDisplayNameDupeOfCommunityMember*(self: Controller, displayName: string): proc getCommunityById*(self: Controller, communityId: string): CommunityDto = result = self.communityService.getCommunityById(communityId) -proc getCuratedCommunities*(self: Controller): seq[CommunityDto] = - result = self.communityService.getCuratedCommunities() - proc spectateCommunity*(self: Controller, communityId: string): string = self.communityService.spectateCommunity(communityId) diff --git a/src/app_service/service/community/service.nim b/src/app_service/service/community/service.nim index 6729a3d184..bfbd641b93 100644 --- a/src/app_service/service/community/service.nim +++ b/src/app_service/service/community/service.nim @@ -873,9 +873,6 @@ QtObject: proc getAllCommunities*(self: Service): seq[CommunityDto] = return toSeq(self.communities.values) - proc getCuratedCommunities*(self: Service): seq[CommunityDto] = - return toSeq(self.getFilteredCuratedCommunities.values) - proc getCommunityById*(self: Service, communityId: string): CommunityDto = if communityId == "": return @@ -1855,7 +1852,7 @@ QtObject: let curatedCommunities = parseCuratedCommunities(rpcResponseObj["response"]["result"]) for curatedCommunity in curatedCommunities: self.communities[curatedCommunity.id] = curatedCommunity - self.events.emit(SIGNAL_CURATED_COMMUNITIES_LOADED, CommunitiesArgs(communities: self.getCuratedCommunities())) + self.events.emit(SIGNAL_CURATED_COMMUNITIES_LOADED, CommunitiesArgs(communities: curatedCommunities)) except Exception as e: let errMsg = e.msg error "error loading curated communities: ", errMsg