Problem
The KaiOS app may not work as expected on all devices or it may start breaking for any reason. The only way we would have to figure this out right now would be through user feedback, which we don't even have. See T236317: Allow users to provide feedback from within the app
Solution
Implement client-side error logging. See T226986: Client side error logging production launch
Client-side errors should be sent using navigator.sendBeacon to https://intake-logging.wikimedia.org
The message should conform to this schema: https://schema.wikimedia.org/repositories//primary/jsonschema/mediawiki/client/error/current.yaml
{ $schema: "/mediawiki/client/error/1.0.0", // (required) this literal string meta: { stream: "mediawiki.client.error", // (required) this literal string }, error_class: <your error class here>, // (optional) the class of the error constructor message: <your message here>, // (required) A message explaining the error url: <your URL here>, // (optional) URL of the resource where the error happened file_url: <your file URL here>, // (optional) URL of the file that threw the error }
See this example: https://github.com/wikimedia/mediawiki-extensions-WikimediaEvents/blob/master/modules/ext.wikimediaEvents/clientError.js#L34
A new stream will be created to distinguish the KaiOS errors from the MediaWiki errors. See T250177: Create KaiOS error stream
API errors that are NOT caused by the device being offline should be captured and sent.
We should investigate if preact has a generic error handler that we can hook up with.