Introduce soft assertions in MediaWiki
Open, Needs TriagePublic

Description

Input type documentation of older MediaWiki methods often does not match reality, which can result in breakage (T200456: MapCacheLRU::has called with invalid key. Must be string or integer. is an example). Newer code often uses wikimedia/assert to ensure correct input, but in older code that would cause breakage just the same.

We could add a "soft" version of assertions which logs invalid input but does not throw, add such assertions to common MediaWiki core classes, and use them to bring the parameter type documentation in sync with reality.

Tgr created this task.Aug 3 2018, 7:02 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 3 2018, 7:02 PM
Tgr added a subscriber: daniel.Aug 9 2018, 11:03 PM

@daniel any thoughts? Is this generic enough that maybe it should be discussed as an IRC? Or is it still in just-do-it-land?