Commit 311c8c2
Update auth token before sending it when the connection is established.
Current we send auth token to server whenever get/set (put/listen) request is queue, if the connection has been established.
It is not a very nice implementation and more changes will be made in b/123781317
This change would fix a bug if the event happens in the following order.
- Auth sign-in.
- auto db = Database::GetInstance(); (Create database, start connecting to server)
- db.GetReference().SetValue(1); (Put request added, and queue as pending request. But no token sent because connection is not established yet)
- Connection established. OnReady() called. Since it does not retrieve auth_token_ at this point, no auth token would be sent to the server.
- Pending put requests sent before auth token message is sent => may result in permission deny.
PiperOrigin-RevId: 2464323661 parent a90d8db commit 311c8c2
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
190 | 193 | | |
191 | 194 | | |
192 | 195 | | |
| |||
0 commit comments