wordpress-mobile / wordpress-mobile/WordPress-iOS
WPAccount needs nullability info
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 3.9k
- Forks
- 1.2k
- Avg merge
- 23h 51m
- Merged PRs (30d)
- 58
Description
Because WPAccount is written in Objective-C and has no nullability information there are situations in which accessing its properties can crash in swift. To compound this problem, sometimes they can occur at launch within signinForWPComFixingAuthToken. This leads to a situation in which the user must delete the app and reinstall.
Luckily, this specific situation arose from my working in signup code, and I think is very unlikely to happen in production (at least, not for the same reasons).
My preferred solution would be to rewrite the class in swift, but at the least we should accurately tag the properties with nullability attributes.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Objective-C WPAccount class and the signinForWPComFixingAuthToken flow mentioned in the issue. Review how WPAccount properties are exposed to Swift and identify the nullability information they need. Done means the properties are accurately annotated so Swift access cannot assume an invalid value without appropriate handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- objective-c, swift
- Domain
- authentication, mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100