When moving to packageFiles, the modules errorLogging and toc
were not imported by init.js meaning they were not run.
ResourceLoader should probably error in this situation, but until
then we should fix this problem.
This is a follow up to I44790dd3fc6fe42bb502d79c39c4081c223bf2b1
Bug: T212944
Change-Id: I86efb7be1c39b03f63c8f1e0b107216cd30ff6de
In I02f8645aac1d7b081eaba8f2ac92a2ef51f78182, Page.js was made into a
model and its html parsing responsibilities were moved to
PageHTMLParser. Additionally, a singleton for the current page
(currentPage.js) and a singleton for the curent page html parser
(currentPageHTMLParser.js) were introduced to replace the usage of
M.getCurrentPage().
This commit refactors Minerva to make use of these changes.
Notable changes:
* 🐛 The event bus singleton was added to references.js since it
previously relied on an instance of Skin to listen for the
`references-loaded` event. However, this event is emitted on the event
bus singleton.
* Additionally, I didn't see a reason why the `references-loaded` event
needed to also pass the current page instance when the only file
listening to it is references.js (which already has the current page
instance) so I removed that and the convoluted passing of page.js within
the file. I assumed this logic was unecessary.
* The call to drawer.showReferences in references.js now was made to
pass the currentPage instance as well as the currentPageHTMLParser. This
is to prepare for I6e858bbe73f83166476b5b2c0fdac1cca7404246 where the
getReferences() interface for ReferencesMobileViewGateway.js and
ReferencesHtmlScraperGateway.js is refactored to accept both of these
instances. Additionally, references.js was refactored to support event
delegation which gets rid of some parsing/setup logic.
Bug: T193077
Depends-On: I02f8645aac1d7b081eaba8f2ac92a2ef51f78182
Change-Id: I2f32dbcc4ebaa4bebb297cda1ecce3457922b343
Logged in users may be more likely to have client side errors - either
through using interfaces that require authentication or through gadgets
that they run. I'd like to separate the two.
Bucketing like this means we can still continue to count all client
side errors, but we can have additional graph lines for logged in.
This way we can notice spikes in bugs limited to logged in users
for example T216853
Change-Id: I965c45f8b548abb16b400571ddf7852ca088529b
We talked about this in standup today and given Sam's comment
in T212970#4943448 and a potential loss of data, we've considered
this a little risky and would like to revert and discuss this.
We can reapply the patch later if necessary.
This reverts commit a486bde329.
Bug: T212970
Change-Id: I0aad3937dde92bf7a46df8c1cf892bf5ce257e17
To minimize the traffic sent to the stats endpoint we should
track errors only once after request is done, not on every
error occurence.
Bug: T212970
Change-Id: I64f101159aa1f2179e612effa850851fffcf39c6
Replace all occurrences of `M.require( 'mobile.startup/pathToModule' )`
with `M.require( 'mobile.startup' ).pathToModule`. Where multiple
requires existed, add an intermediate variable,
`var mobile = M.require( 'mobile.startup' )`, and dot off that.
This changes improves the consistency of MinervaNeue which currently
contains a mix of require styles and eliminates any deprecated requires.
Bug: T208915
Change-Id: If14f280672d914d07275197100b12421bb217b67
Rather than using err and error as variable, use error for consistency
Follow up to I07f01b4c025b2e5e4cbf88ec05e7c536442c62cc
Bug: T202026
Change-Id: I54165ff1f1b17284d8232c491244e1a98950d5e2
This adds a client side error logger that will store errors
in EventLogging. We will use it to get a sense of the number
of errors inside mobile.
To enable make use of the new configuration variable
wgMinervaErrorLogSamplingRate = 1
Notes:
* the optional `meta` field will not be utilised by the generic
error handler.
* URI length is not trimmed for title. We will consider whether we need
to make any adjustments to the schema values during roll out.
** For stack trace, we limit the length by removing errorUrl (which is logged
separately)
Testing:
Add throw new Error('asasasa'); anywhere in your code and make
sure the code executes. It should trigger an Error event provided
that configuration has been updated.
Bug: T202026
Change-Id: I07f01b4c025b2e5e4cbf88ec05e7c536442c62cc