Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offline integration does not seem to work #369

Closed
7 tasks done
chetbox opened this issue Sep 29, 2021 · 4 comments · Fixed by #392
Closed
7 tasks done

Offline integration does not seem to work #369

chetbox opened this issue Sep 29, 2021 · 4 comments · Fixed by #392

Comments

@chetbox
Copy link
Contributor

chetbox commented Sep 29, 2021

Versions + Platform

  • SDK version - @sentry/electron@v2.4.0
  • Electron version - electron@v12.0.9
  • Platform - Linux

Description

We initialise Sentry like this as described in the docs:

const { Offline: OfflineIntegration } = require('@sentry/integrations');

const { logger } = require('@sentry/utils');
logger.enable();

Sentry.init({
      dsn: '...',
      integrations: [new OfflineIntegration()],
});

If I turn off wifi and start the application I see the following log when I force an error from the main process:

Sentry Logger [Error]: Error while sending event: Error: net::ERR_INTERNET_DISCONNECTED

Forcing an error from the main process or from the renderer does not seem to cause an error to be logged to Sentry, even when restarting the application.

EDIT:

Forcing an error from a renderer process gives a different error, but when the machine becomes online:

Sentry Logger [Error]: Error while sending event: Error: net::ERR_NAME_NOT_RESOLVED
@timfish
Copy link
Collaborator

timfish commented Sep 30, 2021

I've never looked at the OfflineIntegration so I'd guess it was never designed to work with the Electron SDK.

It's certainly something that would be useful though so I'll look into it.

@timfish
Copy link
Collaborator

timfish commented Sep 30, 2021

Just checked the code and it uses localForage which is browser only so this won't play very well with the Electron SDK.

The Electron SDK merges all context and breadcrumbs in the main process so you get the same data for both JavaScript and native crashes. The main process is nodejs so that integration simply won't work there.

We already handle queuing native crashes if there is no connection and it would make sense to do this for JavaScript errors too.

@chetbox
Copy link
Contributor Author

chetbox commented Sep 30, 2021

Does this mean offline crashes will be stored and uploaded when online from the main process without the Offline plugin?

The Electron docs suggest the Offline plugin is designed to work with Electron.

@timfish
Copy link
Collaborator

timfish commented Sep 30, 2021

Does this mean offline crashes will be stored and uploaded when online from the main process without the Offline plugin?

Currently only for native crashes. JavaScript errors are currently dropped if there is no connection.

The Electron docs suggest the Offline plugin is designed to work with Electron.

I suspect that this is because the Electron docs are derived from the core JavaScript docs so much of the JavaScript stuff gets included too. I'll open an issue about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants