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

fix: change abort to aborted event #8282

Merged
merged 5 commits into from
Aug 11, 2024

Conversation

beyondkmp
Copy link
Collaborator

@beyondkmp beyondkmp commented Jun 29, 2024

There are many SimpleURLLoaderWrapper server error in sentrty, I think they might be caused by this event.

Here's a simple example:

// test.js
'use strict';

// The same issue occurs with `http`, too.
const https = require('https');

const req = https.request('https://nodejs.org/dist/v13.7.0/node-v13.7.0.tar.gz');
req.on('response', (res) => {
  res
    .on('end', () => console.log('end'))
    .on('close', () => console.log('close'))
    .on('aborted', () => console.log('aborted'))
    .on('error', (err) => console.log(err));

  setTimeout(() => {
    console.log('start');
    req.abort();
  }, 500);
});
req.end();

Copy link

changeset-bot bot commented Jun 29, 2024

🦋 Changeset detected

Latest commit: 3cb8446

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
electron-updater Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

netlify bot commented Jun 29, 2024

Deploy Preview for car-park-attendant-cleat-11576 ready!

Name Link
🔨 Latest commit 3cb8446
🔍 Latest deploy log https://app.netlify.com/sites/car-park-attendant-cleat-11576/deploys/66968621d2a89000080b74e9
😎 Deploy Preview https://deploy-preview-8282--car-park-attendant-cleat-11576.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@beyondkmp
Copy link
Collaborator Author

beyondkmp commented Jun 29, 2024

Here's a minimal example, with an 'aborted' event. However, I'm currently not sure why this event isn't documented.

// test.js
'use strict';

// The same issue occurs with `http`, too.
const https = require('https');

const req = https.request('https://nodejs.org/dist/v13.7.0/node-v13.7.0.tar.gz');
req.on('response', (res) => {
  res.on('aborted', () => console.log('aborted'))
  res.on('abort', () => console.log('abort'))

  setTimeout(() => {
    console.log('start');
    req.abort();
  }, 500);
});
req.end();

@mmaietta
Copy link
Collaborator

Okay, that's super weird indeed. Thanks for the test script! Maybe we should have both listeners (just in case for backward compatibility)?

Any chance you'd be willing to post a screenshot of what error you're seeing in Sentry?

@beyondkmp
Copy link
Collaborator Author

@mmaietta Here's the detailed sentry error. Because we recently enabled differential udpate, such errors have increased, so I suspect there is a connection here.

image

@mmaietta
Copy link
Collaborator

Any chance you'd be willing to test this on your app locally using patch-package first? I don't immediately see any harm/side-effects in the changes in this PR, but I don't have a way to verify locally via unit tests AFAICT.

@beyondkmp
Copy link
Collaborator Author

Unfortunately, I cannot reproduce this issue locally at the moment. It only seems to occur frequently in production when there is a large user base. I'll have to wait for production to test it out.

@mmaietta
Copy link
Collaborator

@beyondkmp any luck with your patched production build rollout? Looking to determine next steps with this PR 🙂

@beyondkmp
Copy link
Collaborator Author

It hasn't been released yet. Once it is released and we have results, I will provide immediate feedback.

@beyondkmp
Copy link
Collaborator Author

@mmaietta Based on the release results, network errors have not increased; instead, they have decreased, although they have not been completely eliminated.

From the results, my suggestion is that this can be merged.

@mmaietta mmaietta merged commit 15ce5b4 into electron-userland:master Aug 11, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants