Skip to content

Refactor online_friends and friend_screen to prevent a hang#3135

Merged
veloce merged 1 commit into
lichess-org:mainfrom
freebeartogoodhome:newFriend
May 8, 2026
Merged

Refactor online_friends and friend_screen to prevent a hang#3135
veloce merged 1 commit into
lichess-org:mainfrom
freebeartogoodhome:newFriend

Conversation

@freebeartogoodhome

Copy link
Copy Markdown
Contributor

online_friends.dart
Change the build to non-blocking by returning an initial empty state and updating it reactively via the socket stream

friend_screen.dart
Remove async/await to use ref.watch(provider) directly

});

final onlineAndFollowingProvider =
FutureProvider.autoDispose<(IList<OnlineFriend> onlineFriends, IList<User> following)>((

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FutureProvider already returns an AsyncValue so we should keep that.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I kept your work but chose to go even further in the simplification and remove the combined provider.

@veloce veloce merged commit 98aab89 into lichess-org:main May 8, 2026
1 check passed
@freebeartogoodhome freebeartogoodhome deleted the newFriend branch May 12, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants