Fix follow being stuck as pending after accept (#2366)

* Fix follow being stuck as pending after accept

* fix api test
This commit is contained in:
Nutomic 2022-07-20 14:10:29 +00:00 committed by GitHub
parent 767f1aa0de
commit eee8f467b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 5 deletions

View file

@ -26,13 +26,10 @@ test('Follow federated community', async () => {
betaCommunity.community.id betaCommunity.community.id
); );
// Wait for it to accept on the alpha side ( follows are async )
await delay();
// Make sure the follow response went through // Make sure the follow response went through
expect(follow.community_view.community.local).toBe(false); expect(follow.community_view.community.local).toBe(false);
expect(follow.community_view.community.name).toBe('main'); 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 // Check it from local
let site = await getSite(alpha); let site = await getSite(alpha);

View file

@ -294,7 +294,7 @@ impl Followable for CommunityFollower {
.filter(community_id.eq(community_id_)) .filter(community_id.eq(community_id_))
.filter(person_id.eq(person_id_)), .filter(person_id.eq(person_id_)),
) )
.set(pending.eq(true)) .set(pending.eq(false))
.get_result::<Self>(conn) .get_result::<Self>(conn)
} }
fn unfollow( fn unfollow(