Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profile Pic Bug #80

Closed
teloanus opened this issue Aug 7, 2020 · 4 comments
Closed

Profile Pic Bug #80

teloanus opened this issue Aug 7, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@teloanus
Copy link

teloanus commented Aug 7, 2020

sir. is this issues clear already ? "Profile Picture bug ".
because i still got the problem. for example. when we upload the new profile picture then we post a tweet. then on the recent tweet will show our new profile picture which is correct, while in the old post.. the profile picture still shows the old one. I mean why it doesn't change for all automatically. Thanks sir.

@TheAlphamerc
Copy link
Owner

@teloanus This is a known issue right now. The profile picture is not updated in old tweets because when user creates a tweet his name, profile picture URL is saved with tweets information in db and in new tweets it gets new profile URL.
Screenshot 2020-08-08 at 11 34 23 AM

How to fix this

This issue can be fix if user info can fetched from profile table instaed of getting in from user object which is saved in tweet itse

The disadvantage of getting user info for every tweet is that it will create several active connections with database and leads to slow app performance.

@TheAlphamerc TheAlphamerc added the bug Something isn't working label Aug 11, 2020
@TheAlphamerc
Copy link
Owner

For workaround user updated information can be taken from the search state.
Add below code in lib/widgets/tweet/tweet.dart under build method.

   final searchState = Provider.of<SearchState>(context, listen: false);
    model.user.profilePic = searchState.userlist.firstWhere((x) => x.userId == model.user.userId).profilePic;

Screenshot 2020-08-12 at 10 19 20 AM

@qwerty684
Copy link

@TheAlphamerc can we make that this change in real time, now work just when we close app and reopen?

@TheAlphamerc
Copy link
Owner

@emiravdovic to make it realtime you can add pull to refresh functionality on the search page. Once you refresh user's list it will update the profile pic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants