Page MenuHomePhabricator

Log modules enqueued with invalid module target
Closed, ResolvedPublic


Various extensions use OutputPage::addModules().

If a target field is not set on the module (defaults to desktop) and the module is run on mobile it is silently removed.

When this happens we should log it. It is important when we remove targets that it is effectively a no-op (no known violations).

At first this'll have to be log level "debug" to avoid flooding production with very common violations. Later level "warning" to find any less common ones in production.


Related Gerrit Patches:

Event Timeline

Restricted Application removed a project: Patch-For-Review. · View Herald TranscriptJul 18 2016, 7:35 PM
Restricted Application added a subscriber: Zppix. · View Herald Transcript
Krinkle added a comment.EditedJul 18 2016, 8:06 PM

The logging for this should go into a server-side logging channel (e.g. "resourceloader"). Can be of type warning indeed.

Though at first that'll cause a lot of logging overhead, may want to do "logger->debug" first so that we can fix first fix the common cases based on the verbose debug output from canary servers, vagrant and Jenkins.

Example: OutputPage.php#L2788-L2794

Jdlrobson raised the priority of this task from Low to Normal.Jul 21 2016, 8:36 PM
Krinkle renamed this task from Log any modules that are attempted to be loaded on mobile to Log modules enqueued with invalid module target.Aug 5 2016, 2:11 AM
Krinkle updated the task description. (Show Details)

@Krinkle do you have plans to do this in the near future?

Krinkle claimed this task.Jan 4 2017, 4:58 AM
Krinkle added a project: Performance-Team.
Krinkle moved this task from Accepted Enhancement to Assigned on the MediaWiki-ResourceLoader board.

Change 336649 had a related patch set uploaded (by Krinkle):
resourceloader: Move target filter to ClientHtml and log violations

Change 336649 merged by jenkins-bot:
OutputPage: Log violations of module 'target' filter

Krinkle closed this task as Resolved.Feb 15 2017, 8:29 PM