Page MenuHomePhabricator

mobile.startup/user should be passed in as a parameter to all our View code
Closed, DuplicatePublic


From code review session on 2nd August:
To make it clearer where and how the mw.user object literal or M.require( 'mobile.startup/user' ) is used inside a class, we believe it might be better to pass this parameter into Views as a parameter rather than using an M.require statement.

Developer notes

  • mw.user is used in MobileWebSearchLogger, TalkOverlay, EditorOverlayBase, BetaOptinPanel
  • The mobile.startup/user module is used in TalkOverlay.js, TalkSectionOverlay.js, Watchstar.js, WatchstarPageList.js, schemaMobileWebMainMenuClickTracking.js, EditorOverlayBase.js

The required MobileFrontend changes is illustrated in this patch:

A change will need to be made in MinervaNeue beforehand to pass the user parameter to the above classes.

Event Timeline

I don't know so I'll ask: do we have sufficient test coverage so that that this task should be tagged easy?

In short - let's wait till we've talked about this in grooming and estimated it. We should check we are all okay with the change and understand the motivations. That will show up in a discussion. If it's a 1 or 2 and we all have consensus about the change yes we should slap the easy tag on it.

Estimations around 2-5 .. need to investigate the scale of what this change would like this.

Change 372077 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] User always passed in as an argument to classes

Change 372077 abandoned by Jdlrobson:
User always passed in as an argument to classes