element-hq / element-hq/element-ios
Handling universal links causes crash when the user is logged out
- Dominant language
- Swift
- Stars
- 1.8k
- Forks
- 544
- PR merge metrics
- PR metrics pending
Description
### Steps to reproduce
1. Log out of Element app
2. Open the app by triggering universal link for user
3. Navigate back by selecting `All chats`
4. Notice that All chats view is empty since it has no data to populate
5. When you select spaces button from tab bar or search bar, notice the app crashes
https://github.com/user-attachments/assets/3e3f7acb-e359-499b-96d0-1c4e9fe68ca5
### Outcome
#### What did you expect?
- I would expect that `/user` universal link to be handled in the same way as the `/room` universal link: when there is no account, the app should display the authentication controller, wait for a a successful login, and then retry the link.
#### What happened instead?
- In `LegacyAppDelegate`, when the `/user` link is received, the check for `activeAccounts` is missing, so contact details controller is presented anyway. Therefore, if the user interacts with the UI, the app crashes.
### Your phone model
iPhone 15 Plus
### Operating system version
17.5
### Application version
1.11.17
### Homeserver
_No response_
### Will you send logs?
Yes
Contributor guide
Research direction
Start in LegacyAppDelegate and compare handling of the /user universal link with the existing /room link flow. Reproduce the logged-out navigation described in the issue, then verify that the authentication controller is shown before contact details and that the link is retried after login without the app crashing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- authentication, mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100