wordpress-mobile / wordpress-mobile/WordPress-iOS

WPAccount needs nullability info

Open
#8,724 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

[Type] Tech Debt Core Data
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.

screen shot 2018-02-26 at 9 38 15 am

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.