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

P2P updater #473

Closed
wants to merge 4 commits into from
Closed

P2P updater #473

wants to merge 4 commits into from

Conversation

team-pct
Copy link

@team-pct team-pct commented Nov 8, 2016

##P2P updater

Changes proposed in this pull request:

  • Update Updater.js
  • Add UpdateSeed on Settings
  • Add Webtorrent on package.json

I've read the Contributor License Agreement

  • P2P updater

* P2P updater

* Update Updater.js
* Add UpdateSeed on Settings
* Add Webtorrent on package.json
Copy link
Member

@xaiki xaiki left a comment

Choose a reason for hiding this comment

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

THANK YOU, for a very interesting PR.

i'm not sure why we change the way the update is installed once finished, i'd like this to be optional for now, and before we merge we need to setup the butter infrastructure for this.

@@ -57,6 +57,6 @@ var

// Torrent engines
peerflix = require('peerflix'),

WebTorrent = require('webtorrent'),
Copy link
Member

Choose a reason for hiding this comment

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

we don't need this as a global, please keep it in updater.js

Copy link
Author

Choose a reason for hiding this comment

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

We will need it with the new streamer running on Webtorrent Please see #424 #470

Copy link
Member

Choose a reason for hiding this comment

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

we can change that when it gets merged.

@@ -149,6 +149,7 @@ Settings.tmpLocation = path.join(os.tmpDir(), Settings.projectName);
Settings.databaseLocation = path.join(data_path, 'data');
Settings.deleteTmpOnClose = true;
Settings.automaticUpdating = true;
Settings.UpdateSeed = true;
Copy link
Member

Choose a reason for hiding this comment

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

either Settings.update = {seed: true}, or Settings.seedUpdate

Copy link
Author

Choose a reason for hiding this comment

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

Settings.seedUpdate is a parameter on setting container ,
People can disable seeding if they are on the last version

Copy link
Member

Choose a reason for hiding this comment

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

it's just a name nitpick 'seedUpdate' isn't really clear to me.

Copy link
Member

Choose a reason for hiding this comment

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

how windowsy of you

Copy link
Member

Choose a reason for hiding this comment

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

naming convention is bad, you should use seedUpdate or redistributeUpdater, but don't start with an uppercase :)

@team-pct
Copy link
Author

team-pct commented Nov 8, 2016

I am not sure what you mean by changing the updater behavior but we just included web torrent and kept the Flow of the current updater

@team-pct team-pct closed this Nov 8, 2016
@xaiki
Copy link
Member

xaiki commented Nov 10, 2016

your PR changed a lot of things (more than can be reviewed) in updater.js, let's talk on IRC/Slack and find a way to make this mergeable.

@xaiki xaiki reopened this Nov 10, 2016
Copy link
Member

@vankasteelj vankasteelj left a comment

Choose a reason for hiding this comment

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

Some remarks

@@ -149,6 +149,7 @@ Settings.tmpLocation = path.join(os.tmpDir(), Settings.projectName);
Settings.databaseLocation = path.join(data_path, 'data');
Settings.deleteTmpOnClose = true;
Settings.automaticUpdating = true;
Settings.UpdateSeed = true;
Copy link
Member

Choose a reason for hiding this comment

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

naming convention is bad, you should use seedUpdate or redistributeUpdater, but don't start with an uppercase :)

@@ -60,6 +60,7 @@
"nodecast-js": "^1.0.1",
"opensubtitles-api": "^3.1.0",
"peerflix": "^0.35.0",
"webtorrent": "0.97.2",
Copy link
Member

Choose a reason for hiding this comment

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

better use 0.x.x or ^0.97.2

<input class="settings-checkbox" name="events" id="cb6" type="checkbox" <%=(Settings.events? "checked='checked'":"")%>>
<label class="settings-label" for="cb6"><%= i18n.__("Celebrate various events") %></label>
<input class="settings-checkbox" name="UpdateSeed" id="cb6" type="checkbox" <%=(Settings.UpdateSeed? "checked='checked'":"")%>>
<label class="settings-label" for="cb6"><%= i18n.__("Activate Update Seeding") %></label>
Copy link
Member

Choose a reason for hiding this comment

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

It's personnal and doesn't really impair the merge of this, but I don't like the string. For starter, you don't need the word "activate" in it, the checkbox says that already.
How about:

  • "Seed update files to other users"
  • "Redistribute the update packages"

@@ -3,6 +3,8 @@

var CHANNELS = ['stable', 'beta', 'nightly'],
FILENAME = 'package.nw.new',
WebTorrent = require('webtorrent'),
client = new WebTorrent({dht: true,maxConns: '5'}),
Copy link
Member

Choose a reason for hiding this comment

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

Is the maxConns needed? It fallsback to 55, why forcing a lower number?

win.debug('ERROR' + err.message);
});
torrent.on('done', function () {
win.debug('Seeding the Current Update!');
Copy link
Member

Choose a reason for hiding this comment

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

Once 'done', it doesn't seed, according to my tests. You need to explicitly set it with the .seed() api call (I think?)

Copy link
Member

Choose a reason for hiding this comment

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

so it looks like seed() is to create a new torrent, i'm not sure how seed control works...

}, function (torrent) {
win.debug('Downloading update... Please allow a few minutes');
torrent.on('error', function (err) {
win.debug('ERROR' + err.message);
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't it be win.warn('Downloading update failed:', error) ? Make it visible but not a 'breaking' error, and also comprehensible.

});
torrent.on('done', function () {
win.debug('Update downloaded!');
defer.resolve(path.join(outputDir, torrent.name));
Copy link
Member

Choose a reason for hiding this comment

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

torrent.name contains the extension of the file in this case? Because there's a risk it's a directory

Copy link
Member

Choose a reason for hiding this comment

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

we create the update torrent.

@xaiki xaiki mentioned this pull request Dec 18, 2016
@xaiki
Copy link
Member

xaiki commented Nov 1, 2020

closing as #545 rebases it

@xaiki xaiki closed this Nov 1, 2020
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