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

Unity 5.6.3p1 4.2.1 Phantom UID on fresh install + non auth retrieval breaking things #125

Closed
PathToLife opened this issue Nov 24, 2017 · 3 comments

Comments

@PathToLife
Copy link

PathToLife commented Nov 24, 2017

Unity 5.6.3p1 4.2.1 Phantom UID on fresh install + non auth retrieval breaking things

Probably related to the Unity task.dll screw up, but I'd like to document this to help others:
On occasion this pops up on the editor 💯 :

WebSocket: ws_3 - WebSocketException during handshake
Firebase.Database.Internal.TubeSock.WebSocketException: unknown host:

Reproduction steps, tested on both Android and IOS devices. Reproduction success seems to be correlated with router speed as well, so try use public wifi:

_Many thanks to anyone that could pop in their expertise! 🥇 _

  1. Fresh install of apk / Clear Local App Data / Built on Unity 5.6.3p1, Firebase 4.2.1
  2. Successfully retrieve some data without being authed
  3. ^ if you did the above step, steps 8-11 will not result in successful read
  4. Check UID with auth.currentuser != null -> get auth.currentuser.uid
  5. Get Weird Residual Non Valid UID
    Detected UID: LqFrMjrmu4RGUXJusIfu9554DXn1 | attempting to fetch data
  6. Read Database in location where ".read":"$key" === "auth.uid"
  7. 11-22 22:16:59.101 25507 26669 W Unity :
    11/22/2017 09:16:59 [Warn] SyncTree: Listen at /userspublic/LqFrMjrmu4RGUXJusIfu9554DXn1 failed: DatabaseError: Permission denied
    11-22 22:16:59.171 25507 25979 E Unity: Unable to Retrieve data System.AggregateException: Exception of type 'System.AggregateException' was thrown.
  8. Signing out.
  9. Sign In with Valid User
  10. 11-22 22:17:00.840 25507 25979 I Unity : User wNk88wov2rcyRk9WXhFFqD3qxs52 (app __FIRAPP_DEFAULT) changed.
    11-22 22:17:00.858 25507 25979 I Unity : Sign-in completed
  11. Read Database in location where ".read":"$key" === "auth.uid"
  12. Success

11-22 22:16:53.612 25507 25979 I Unity : Starting checks...
11-22 22:16:54.717 25507 25979 I Unity : Talking to bubble guards...
11-22 22:16:54.719 25507 25979 I Unity : Detected UID: LqFrMjrmu4RGUXJusIfu9554DXn1 | attempting to fetch data
11-22 22:16:54.723 25507 25979 I Unity : Getting Valuables from bubble HQ...
11-22 22:16:54.724 25507 25979 I Unity : Got request to FetchUserData Request #0 Allowed: True
11-22 22:16:56.443 25507 25979 E Unity : System.AggregateException: Exception of type 'System.AggregateException' was thrown.
11-22 22:16:56.443 25507 25979 E Unity : -----------------
11-22 22:16:56.443 25507 25979 E Unity : Firebase.FirebaseException: An internal error has occurred. [ ����USER_NOT_FOUND ]
11-22 22:16:57.144 25507 26674 E Unity : Unable to find libc
11-22 22:16:59.101 25507 26669 W Unity : 11/22/2017 09:16:59 [Warn] SyncTree: Listen at /userspublic/LqFrMjrmu4RGUXJusIfu9554DXn1 failed: DatabaseError: Permission denied
11-22 22:16:59.171 25507 25979 E Unity : Unable to Retrieve data System.AggregateException: Exception of type 'System.AggregateException' was thrown.
11-22 22:16:59.171 25507 25979 E Unity : -----------------
11-22 22:16:59.171 25507 25979 E Unity : Firebase.Database.DatabaseException: Firebase Database error: Permission denied
11-22 22:16:59.173 25507 25979 E Unity : System.AggregateException: Exception of type 'System.AggregateException' was thrown.
11-22 22:16:59.173 25507 25979 E Unity : -----------------
11-22 22:16:59.173 25507 25979 E Unity : Firebase.Database.DatabaseException: Firebase Database error: Permission denied
11-22 22:16:59.174 25507 25979 E Unity : Firebase Auth Token Not Accepted
11-22 22:16:59.176 25507 25979 I Unity : Signing out.
11-22 22:16:59.187 25507 25979 I Unity : Waiting for Log in...
11-22 22:16:59.187 25507 25507 I Unity : ID token changed. Notifying 1 listeners.
11-22 22:16:59.188 25507 25507 I Unity : Auth state changed. Notifying 1 listeners.
11-22 22:16:59.189 25507 25979 I Unity : Attempting to sign in as sean@qq.com...
11-22 22:16:59.257 25507 25979 I Unity : Stopped token refresh of auth object associated with app __FIRAPP_DEFAULT.
11-22 22:17:00.826 25507 25507 I Unity : CurrentUser changed from 0 to 2D66
11-22 22:17:00.826 25507 25507 I Unity : ID token changed. Notifying 1 listeners.
11-22 22:17:00.827 25507 25507 I Unity : CurrentUser changed from 2D66 to 102D66
11-22 22:17:00.827 25507 25507 I Unity : Auth state changed. Notifying 1 listeners.
11-22 22:17:00.840 25507 25979 I Unity : User wNk88wov2rcyRk9WXhFFqD3qxs52 (app __FIRAPP_DEFAULT) changed.
11-22 22:17:00.858 25507 25979 I Unity : Sign-in completed
11-22 22:17:00.862 25507 25979 I Unity : Getting Valuables from bubble HQ...
11-22 22:17:00.862 25507 25979 I Unity : Got request to FetchUserData Request #1 Allowed: True
11-22 22:17:02.920 25507 25979 I Unity : Database type: MainMenu

@stewartmiles
Copy link
Contributor

@PathToLife did you figure out what was going on here?

@PathToLife
Copy link
Author

Hi Stewart we've been getting inconsistent occurrences of the Phantom UID on fresh install..
It's making it damn hard to reproduce a bug that only occurs half the time.

I'm hoping someone else can confirm this else, we're still kinda blind, I'll report back next year when we've finished migrating to unity 2017. There's several new UI bugs introduced when we migrate.

Current Plan:
Trial and Error till one change fixes this issue. Then report back.
Most likely fix: Take the hit and Upgrade to Unity 2017

@stewartmiles
Copy link
Contributor

@PathToLife I'm wondering whether you're seeing problems with the auth token for a user expiring. Auth tokens expire after 1 hour, though we have a token updater that refreshes tokens every ~58 minutes when RT DB or Storage are included in the application. So all I can think of at the moment, is that perhaps you have a user with a token that will expire soon and then when you close and restart the app the token has expired and will not be refreshed until our token updater comes along and does its' job. We'll take a look at our auth token update code to see whether we have a bug in there. In the meantime you could try working around this by forcing a auth token refresh for the current user when the application starts.

@firebase firebase locked and limited conversation to collaborators Oct 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants