verida-js icon indicating copy to clipboard operation
verida-js copied to clipboard

Fix unhandled `TypeError: Failed to fetch` in `NotificationEngineVerida`

Open aurelticot opened this issue 2 years ago • 1 comments

A TypeError: Failed to fetch error from NotificationEngineVerida is frequently raised in the console for webapps using the Verida SDK (client-ts).

On Verida Missions (https://missions.verida.network), almost every user get this error (although they don't notice it) https://veridaio.sentry.io/issues/4254131082/?environment=production&project=4505328358260736&query=is%3Aunresolved&referrer=issue-stream&sort=user&statsPeriod=14d&stream_index=0

It looks like the NotificationEngineVerida is available in the context and used by the MessagingEngineVerida but the Verida Mission webapp doesn't use the context directly nor the messaging engine.

There are two points to investigate in this issue:

  • While a Failed to fetch is always a possibility when calling external APIs, we should check why this one is highly reproduced. (Is it related to the Verida Mission webapp, or related to the APIs being called)
  • Where to handle this error. Bubbling up and error is not an issue as long it is caught somewhere up in the hierarchy. Here it's not the case. As the Verida Missions doesn't seem to use something directly related to where the error originates, catching this error should be done within the SDK.
  • Side question: why the NotificationEngineVerida is used if not directly used by the App

aurelticot avatar Jun 29 '23 04:06 aurelticot

Sentry issue: INCENTIVIZED-TESTNET-WEBAPP-3

sentry[bot] avatar Jun 30 '23 02:06 sentry[bot]