]> Untitled Git - lemmy.git/commitdiff
Fix follow being stuck as pending after accept (#2366)
authorNutomic <me@nutomic.com>
Wed, 20 Jul 2022 14:10:29 +0000 (14:10 +0000)
committerGitHub <noreply@github.com>
Wed, 20 Jul 2022 14:10:29 +0000 (14:10 +0000)
* Fix follow being stuck as pending after accept

* fix api test

api_tests/src/follow.spec.ts
crates/db_schema/src/impls/community.rs

index b5588572fd7f85ef70d0176b28f8c8d29f97ca65..65b7501226a150a2e34073158cd7edb4bf189c94 100644 (file)
@@ -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);
index 45675aa368329851fd456e50d3dd9166a609f7b8..eb92d7a0b3c181ccebed138a1740cb267807bdd5 100644 (file)
@@ -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::<Self>(conn)
   }
   fn unfollow(