From: Nutomic Date: Wed, 20 Jul 2022 14:10:29 +0000 (+0000) Subject: Fix follow being stuck as pending after accept (#2366) X-Git-Url: http://these/git/%24%7B%60data:application/static/%7B%60https:/%7B%60/feeds/%7BpictrsAvatarThumbnail%28user.avatar%29%7D?a=commitdiff_plain;h=eee8f467b5844062b41a78fdd6f2caaf4e9c90b1;p=lemmy.git Fix follow being stuck as pending after accept (#2366) * Fix follow being stuck as pending after accept * fix api test --- diff --git a/api_tests/src/follow.spec.ts b/api_tests/src/follow.spec.ts index b5588572..65b75012 100644 --- a/api_tests/src/follow.spec.ts +++ b/api_tests/src/follow.spec.ts @@ -26,13 +26,10 @@ test('Follow federated community', async () => { betaCommunity.community.id ); - // Wait for it to accept on the alpha side ( follows are async ) - await delay(); - // Make sure the follow response went through expect(follow.community_view.community.local).toBe(false); expect(follow.community_view.community.name).toBe('main'); - expect(follow.community_view.subscribed).toBe(SubscribedType.Pending); + expect(follow.community_view.subscribed).toBe(SubscribedType.Subscribed); // Check it from local let site = await getSite(alpha); diff --git a/crates/db_schema/src/impls/community.rs b/crates/db_schema/src/impls/community.rs index 45675aa3..eb92d7a0 100644 --- a/crates/db_schema/src/impls/community.rs +++ b/crates/db_schema/src/impls/community.rs @@ -294,7 +294,7 @@ impl Followable for CommunityFollower { .filter(community_id.eq(community_id_)) .filter(person_id.eq(person_id_)), ) - .set(pending.eq(true)) + .set(pending.eq(false)) .get_result::(conn) } fn unfollow(