We tried your sample code. It makes no difference. Even with a 5 seconds delay.
It is similar with comments: Adding a comment via amityPosts[index].comment().create().text("text1").send()
updates latestCommentsIds but not latestComments and commentCount of a post.
Hello, our team has released the enhancement to handle this issue in Flutter sdk ver 0.12.0, please let us know if you have further questions. Thank you
Hi, we updated to SDK 0.12.0. Unfortunately, we cannot notice any change in the behavior described earlier? MyReactions and latestComments still do not update immediately.
you can use stream builder to listen to the updated in Amity Post object. so when ever there is any update, you will get an event with latest amity post object with update my reaction and latest comments.
StreamBuilder<AmityPost>(
stream: amityPost.listen.stream,
initialData: amityPost,
builder: (context, snapshot) {
/// Snapshot will always updated object
final value = snapshot.data;
},
)
Another Approach we added in SDK 0.12.0, in case you dont want to use Streambuilder or have nested widgets, future return from the addReaction will always have latest Amity Post Object with my reaction and reactions.
Currently facing a similar issue. Any advice on how to implement your fixes with our app? I gave it a shot on my own but it doesn’t appear to be helping. The myReactions remaining empty is preventing us from letting the users reaction persist through reload. Reactions work as expected until reload where the reaction button returns to its default state. The total count for the reactions persists but the fact that the user reacted to that post does not.
Hi @SocialPlus_Support I am facing the same issue. My usecase is, I am creating a post, after creation I am listening to the post (first post from community) for comments using below code:
Hello, based on our team’s assessment, this behaviour is considered normal for comments on Flutter. While it is possible to implement interval fetching, but we do not recommend it.