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 #184: Use electron/net instead of https to download updates. #187

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Richardn2002
Copy link

At least I can confirm that versions.json retrieval uses proxy now (so that I can boot discord). But I do not know how to force a self-update or modules update, so rest of the update functionalities are untested, for now.

Yeah and I did one of the todos:

// todo: have these https utils centralised?

net utilities are now centralized.

…pdates.

At least I can confirm that `versions.json` retrieval uses proxy now (so that I can boot discord).
But I do not know how to force a self-update or modules update, so rest of the update functionalities are untested, for now.
@Richardn2002
Copy link
Author

wait there is one crazy mistake, hang on, will commit again soon

@Richardn2002 Richardn2002 marked this pull request as ready for review July 16, 2024 08:38
@Richardn2002
Copy link
Author

I have been using my branch for two weeks and I have observed it correctly updating modules and detecting that Discord 0.60.0 has shipped.

src/utils/get.js Outdated
// returns a promise that resolves to [statusCode, Buffer, headers]
// [code, null, null] if request failed
module.exports = async (url) => {
const request = new Request(url, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this use net.request?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can review the current design choice I made. A get utility returning Promises that resolves to response data, and a more sophisticated request utility if more fine-grained control is needed.

With a new networking utility `request`, trying to simplify the confusing `net.request()` interface.
@Richardn2002 Richardn2002 requested a review from CanadaHonk August 7, 2024 14:40
@Richardn2002
Copy link
Author

Richardn2002 commented Aug 7, 2024

As a note, I now find that I indeed can force a hot update by removing the modules folder (I tested latest commits in this way).
When I started working on the PR this didn't work as expected, so I guess the current state of the PR actually corrects something, making OpenAsar successfully start a hot update when there are no modules installed.

@ioj4
Copy link

ioj4 commented Jan 16, 2025

Hi, is there any chance that this could still get merged? I'm interested in this because due to OpenAsar using the https package you are not able to use a http://* URL as an update endpoint. Which makes local testing for uwu/sheltupdate with OpenAsar quite challenging. With stock Discord http endpoints are supported because it also makes use of the electron/net package (src)

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

Successfully merging this pull request may close these issues.

3 participants