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

user.displayName does not parse int the client. #115

Open
imaNNeo opened this issue Sep 19, 2024 · 2 comments
Open

user.displayName does not parse int the client. #115

imaNNeo opened this issue Sep 19, 2024 · 2 comments
Assignees
Labels
type: bug Something isn't working type: question Further information is requested

Comments

@imaNNeo
Copy link

imaNNeo commented Sep 19, 2024

Hi,
I'm using the client in my flutter game, I noticed that the display name is not parsed in the client.

For example, when I run this code, the location gets updated and I can read the new location. But the new display name is updated (I checked the console), but it cannot retrieve it from the back-end.

void updateUserDisplayName() async {
  await client.updateAccount(
    session: _currentSession,
    displayName: 'My Display Name',
    location: 'My Location',
  );
  await Future.delayed(const Duration(seconds: 1));
  final account = await client.getAccount(_currentSession);

  // prints: new displayName: null
  print('new displayName: ${account.user.displayName}');

  // prints: new location: My Location
  print('new location: ${account.user.location}');
}

As you can see, both have been updated in the console. But, the client cannot retrieve the display name. It's always null

image

Nakama client (dart) version: 1.1.0
Nakama back-end (server) version: 3.22.0+4a4c53d7

I'm running it on web, and this is my flutter doctor result:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.3, on macOS 14.6.1 23G93 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] IntelliJ IDEA Community Edition (version 2023.2)
[✓] VS Code (version 1.93.1)
[✓] Connected device (5 available)
[✓] Network resources

• No issues found!

Does anyone know anything about it?

@ilmalte
Copy link
Collaborator

ilmalte commented Sep 20, 2024

Hey @imaNNeo,

Many improvements and bug fixes have been pushed to main since Dart version 1.1.0, and they will be released soon.
You might want to update your pubspec.yaml file to point directly to main for now:

dependencies:
  nakama:
    git:
      url: 'https://github.com/heroiclabs/nakama-dart.git'
      path: nakama

I've tested your code in a clean environment using server version 3.22.0.
Everything is working smoothly with the version in main, but it's failing with the latest version available on pub.dev (1.1.0).

Please try it out on your end and let me know if you run into any issues. Looking forward to your feedback!

P.S. Your game development tutorial using Nakama looks really interesting, keep going!

imaNNeo added a commit to imaNNeo/flappy_dash that referenced this issue Sep 20, 2024
@imaNNeo
Copy link
Author

imaNNeo commented Sep 20, 2024

Hey,

Thanks for your quick response. I just tested it with the main branch and yes, the issue is gone!

Just to mention that the bug only happened on the web btw, when I checked it in Android, it was working correctly.

But now, with the latest changes, it works well on both the Web and Android platforms.
There were some breaking changes, I solved them but I would like to ask 2 questions here. (the commit is here)

1 - Can you explain why rank and score in a leaderboard record are strings now? Because they were just integers before that.
2 - In which situation the records property is null in the LeaderboardRecordList?

Cheers!

@ilmalte ilmalte added type: bug Something isn't working type: question Further information is requested labels Oct 22, 2024
@ilmalte ilmalte self-assigned this Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working type: question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants