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

If the ws disconnected, then createdAt property become current time #1422

Closed
1 task done
alperefesahin opened this issue Dec 28, 2022 · 1 comment · Fixed by #1568
Closed
1 task done

If the ws disconnected, then createdAt property become current time #1422

alperefesahin opened this issue Dec 28, 2022 · 1 comment · Fixed by #1568
Labels
bug Something isn't working sdk-issue Used for issues/bugs opened/reported by customers or us.

Comments

@alperefesahin
Copy link

Which packages are you using?

stream_chat_flutter

On what platforms did you experience the issue?

iOS, Android

What version are you using?

stream_chat_flutter: ^5.1.0

What happened?

I use HydratedBloc, to keep some things in locale storage like Hive or SharedPreferences. So, I wanted to keep user profile data like createdAt, user-role, etc. on my profile page, and I print it from the services section In my codebase. The results surprised me. When the internet connection is available, then it shows the correct user values, but when I close my internet connection, it shows the current time and date.

For example, if a user was created in 2020, and If I close my internet connection, the service returns me to 12/28/2022 and the user role as null.

I'm sure that I use it correctly because I also use firebase auth. Even it's not related to my locale storage solution, because I print in the service section in my codebase. So, I think that's the bug.

Steps to reproduce

in the services section, there is a getter whose name is currentUserStream, and from there, you can find the current user whose name is OwnUser. So, If you debug it, you can see the problem.

Supporting info to reproduce

  @override
  Stream<ChatUserModel> get chatAuthStateChanges {
    return streamChatClient.state.currentUserStream.map(
      (OwnUser? user) {
       print("here my user: $user");
        if (user == null) {
          return ChatUserModel.empty();
        } else {
          return user.toDomain();
        }
      },
    );
  }

Relevant log output

If there is a connection:

flutter: here my user: OwnUser(clg.............3, user, 2022-12-28 19:18:38.720025Z, true, {invisible: false, unread_count: 0, name: Alper, image: https://firebasestorage.googleapis.com/v0/b....4a}, false, null, [], )


If connection is lost:

flutter: here my user: OwnUser(c.....fCrIaS6pB1HDI3, null, null, false, {name: Alper, image: https://firebasestorage.googleapis.com/v0/b/...34a}, false, null, [], null)

Flutter analyze output

No response

Flutter doctor output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@alperefesahin alperefesahin added the bug Something isn't working label Dec 28, 2022
@adasiewiczr adasiewiczr added the sdk-issue Used for issues/bugs opened/reported by customers or us. label Feb 8, 2023
@xsahil03x
Copy link
Contributor

@alperefesahin, are you also using the stream_chat_persistence?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sdk-issue Used for issues/bugs opened/reported by customers or us.
Projects
None yet
3 participants