It is suggested that we move all setMobileBetaMode, isBetaGroupMember, and beta/stable constants from MobileContext into new class, something like MobileUserOptions, or MobileUserMode and keep all logic (reading/writing user options/cookies etc) there. It will be easier to maintain/rewrite this feature, plus if we decide to handle anons, the only place where changes will be required are Special::MobileOptions (for render and submit logic) and that new class. See related T144085 and T143189.
We'd like to work out what the plan for refactoring this code is to remove confusion from code review/estimation.
Outcomes
On a wiki page make it clear how we want to architect this code, so that we all understand the planned refactor by answering these questions in the comments:
- What is needed to move setMobileBetaMode, isBetaGroupMember, and beta/stable constants are moved to a new file or replace them with something unrelated to MobileContext?
- What tests are missing?
- How do we deal withNote isBetaGroupMember is a public API - there are 2 known usages outside MobileFrontend - UniversalLanguageSelector and Minerva - https://github.com/search?q=org%3Awikimedia+isBetaGroupMember&type=Code - … we do modify the public API we will need to follow the official MediaWiki deprecation policy.
- Are there things we should do before taking this on? (We might want to hold off doing this in lieu of a discussed and agreed refactoring plan for MobileContext (see epic))
Sign off steps
Update the epic with the newly revised plan (with all learnings)