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

Bug: Different address printing order between client and server #199

Open
kazimuth opened this issue Dec 20, 2024 · 4 comments · May be fixed by #237
Open

Bug: Different address printing order between client and server #199

kazimuth opened this issue Dec 20, 2024 · 4 comments · May be fixed by #237
Assignees

Comments

@kazimuth
Copy link
Contributor

This was recently reported and is likely a downstream problem caused by the Address format change a little while back.

@kazimuth kazimuth self-assigned this Dec 20, 2024
@bfops bfops changed the title Different address printing order between client and server Bug: Different address printing order between client and server Dec 30, 2024
@bfops
Copy link
Collaborator

bfops commented Jan 13, 2025

From a Discord report:

A couple more issues with identities:

  • Server and client use different endianness when converting identities to strings, which makes them more difficult to compare (ex. in logs)
  • I feel like AuthToken.GetTokenKey() shouldn't be exposed and users should instead be encouraged to use AuthToken.Token. The latter has the stored token, while the former has a key which is used internally to store token in PlayerPrefs. Exposing both makes API confusing
  • Related to the last point in my previous message, DbConnectionBuilder.WithCredentials doesn't even USE identity, so having it as an argument is extremely misleading (and made me lose half an hour on it)

@bfops bfops assigned rekhoff and unassigned kazimuth Jan 27, 2025
@rekhoff
Copy link

rekhoff commented Feb 5, 2025

Unable to reproduce the issue as described, additional clarification required.

Specifically:

  • Different address printing order between client and server - How can this be observed/validated?
  • Server and client use different endianness when converting identities to strings, which makes them more difficult to compare (ex. in logs) - How can this be observed/validated?
  • I feel like AuthToken.GetTokenKey() shouldn't be exposed and users should instead be encouraged to use AuthToken.Token. - If we make AuthToken.GetTokenKey() private, that should satisfy this, and would simply require us checking if AuthToken.Token was present in PlayerPref.
  • DbConnectionBuilder.WithCredentials doesn't even USE identity - As ".WithCredentials" is already deprecated, this is likely already resolved.

Issue is being placed as blocked until further clarification can be provided.

@SteveBoytsun
Copy link
Contributor

 Different address printing order between client and server

I can't repro it on latest release either, so it was probably fixed at some point.

The inconsistency happened when printing identities in C# client vs rust module. If you had two print statements, they would have different outputs. Ex.

  • In Rust, spacetimedb::log::info!("{}", identity); would log abcd
  • In C#, UnityEngine.Debug.Log(identity) would log dcba

@rekhoff rekhoff linked a pull request Feb 5, 2025 that will close this issue
1 task
@rekhoff
Copy link

rekhoff commented Feb 5, 2025

Created #237 to move AuthToken.GetTokenKey() to private. AuthToken.Token can be used to get token value.

Checked most recent builds for behavior:
In Rust, spacetimedb::log::info!("{}", identity); produces abcd
In Unity C# , UnityEngine.Debug.Log(identity) produces abcd

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 a pull request may close this issue.

4 participants