Skip to content

Commit

Permalink
Fix follow being stuck as pending after accept (#2366)
Browse files Browse the repository at this point in the history
* Fix follow being stuck as pending after accept

* fix api test
  • Loading branch information
Nutomic authored Jul 20, 2022
1 parent 767f1aa commit eee8f46
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions api_tests/src/follow.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion crates/db_schema/src/impls/community.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit eee8f46

Please sign in to comment.