-
-
Notifications
You must be signed in to change notification settings - Fork 678
Description
This is the same issue as #4092, but I want to restart that thread now that we understand the cause better and also have sorted out some issues with our debugging data. (Some material copied from comments there.)
Here's a repro recipe:
- Open the app; log into some account, if not already logged in.
- Visit the streams tab.
- Now go to the profile tab, and hit "Switch account".
- Pick some other account, where not logged in.
- Rotate the device, so it goes from portrait to landscape. (Or vice versa is probably just as effective.)
This recipe has a 100% crash rate in my testing so far.
On iOS, the whole app crashes. On Android, the symptom is a bit different: the app becomes a white screen.
I've reproduced this a number of times on iOS at 26.28.151, the current beta. Also reproduced on Android at that version, and on iOS at 26.27.150 and at 26.23.146, which is a release a few months old and the earliest release still conveniently available through TestFlight.
For the crash report as seen in Sentry, see this event. The error message is "Error: Error: Error: Error: Active account not logged in".
The stack trace is in getAuth
(as expected from the error message)... and outside that, it's in the mapStateToProps callback in the connect
call around StreamListCard.
export default connect(state => ({
auth: getAuth(state),
canCreateStreams: getCanCreateStreams(state),
streams: getStreams(state),
subscriptions: getSubscriptions(state),
}))(StreamListCard);
So. It seems like:
- we still have a
StreamListCard
component mounted somewhere; - and we've switched the active account to one that's not logged in -- so that
StreamListCard
is doomed not to work.
I think one thing that's going on is that when you hit "Switch account", and also when you then pick an account to switch to, we just push a new screen onto the navigation stack -- we don't replace the existing main
route, which is the screen that has the StreamListCard component underneath it.
The solution may just be to stop doing that, and instead to replace the existing main
route.