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

improve update polling electron and provide a manual check for updates button #4176

Merged
merged 23 commits into from Jun 22, 2017

Conversation

@t3chguy
Copy link
Collaborator

t3chguy commented Jun 3, 2017

Yet to be tested with Electron updating, don't see anything that could potentially break anything but still...

for #4173

t3chguy added 7 commits Jun 3, 2017
…al in Electron

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

(cherry picked from commit 24e8a30)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

(cherry picked from commit a871815)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

(cherry picked from commit 104c804)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

(cherry picked from commit d878c72)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
@t3chguy t3chguy referenced this pull request Jun 3, 2017
don't break when running a non Squirrel Windows build that has an update url

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
@t3chguy t3chguy force-pushed the t3chguy/updating_stuff branch from b330968 to 93f148f Jun 3, 2017
@ara4n

This comment has been minimized.

Copy link
Member

ara4n commented Jun 6, 2017

having an extra status bar for this feels a bit weird...

Copy link
Member

dbkr left a comment

Couple of comments. Looks good I think but obviously I'm super paranoid about breaking auto-update so will test carefully.

@@ -120,6 +120,7 @@ process.on('uncaughtException', function(error) {
});

electron.ipcMain.on('install_update', installUpdate);
electron.ipcMain.on('checkForUpdates', pollForUpdates);

This comment has been minimized.

Copy link
@dbkr

dbkr Jun 7, 2017

Member

Should probably keep the case consistent on these

render: function() {
let image;
if (this.state.done) {
image = <img className="mx_MatrixToolbar_warning" src="img/warning.svg" width="24" height="23" alt="/!\"/>;

This comment has been minimized.

Copy link
@dbkr

dbkr Jun 7, 2017

Member

This needs a double '' as this is an escaped quote mark (or possibly it should just be 'warning' which is better on screen readers)

This comment has been minimized.

Copy link
@t3chguy

t3chguy Jun 11, 2017

Author Collaborator

This is how it is both in MatrixToolbar and NewVersionBar right now, will change both to match PasswordNagBar (Warning)

This comment has been minimized.

Copy link
@t3chguy

t3chguy Jun 11, 2017

Author Collaborator
t3chguy@DESKTOP-784D1OM:/mnt/c/Users/t3chg/WebstormProjects/riot-web/src$ grep -R mx_MatrixToolbar_warning
components/views/globals/MatrixToolbar.js:                <img className="mx_MatrixToolbar_warning" src="img/warning.svg" width="24" height="23" alt="/!\"/>
components/views/globals/NewVersionBar.js:                <img className="mx_MatrixToolbar_warning" src="img/warning.svg" width="24" height="23" alt="/!\"/>
},

componentWillMount: function() {
PlatformPeg.get().checkForUpdate().done((state) => {

This comment has been minimized.

Copy link
@dbkr

dbkr Jun 7, 2017

Member

I'm not hugely keen on componentWillMount having side effects - I'd prefer if the cause & effect was the other way around, ie. firing off an update check causes the bar to appear (if it was a user-triggered one)

t3chguy added 7 commits Jun 11, 2017
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pass through actual errors
and tidy
needs testing

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
@t3chguy

This comment has been minimized.

Copy link
Collaborator Author

t3chguy commented Jun 11, 2017

moved electron update logic out to updater.js in order to try and tidy electron-main.js

because _t called with undefined interpolation name: errorDetail
even though when its undef its not used to sprinf-js would have been fine...

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
@t3chguy

This comment has been minimized.

Copy link
Collaborator Author

t3chguy commented Jun 12, 2017

Tested with WebPlatform
Remains to be tested with ElectronPlatform
...edit...
Tested with Squirrel.Windows
works fine, but hell downloading those updates takes longer than I thought, a minute almost...

t3chguy added 2 commits Jun 12, 2017
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
@t3chguy t3chguy force-pushed the t3chguy/updating_stuff branch 2 times, most recently from 388a282 to b6d2ba2 Jun 12, 2017
@@ -233,7 +172,7 @@ electron.app.on('ready', () => {

if (vectorConfig.update_base_url) {
console.log(`Starting auto update with base URL: ${vectorConfig.update_base_url}`);
startAutoUpdate(vectorConfig.update_base_url);
updater.start(vectorConfig.update_base_url)

This comment has been minimized.

Copy link
@dbkr

dbkr Jun 20, 2017

Member

Missed semicolon

},

render: function() {
const message = _t(statusText[this.props.status], { errorDetail: this.props.detail || '' });

This comment has been minimized.

Copy link
@dbkr

dbkr Jun 20, 2017

Member

I think we prefer _t on literals wherever possible, so getStatusText() which returns the result of _t instead of the object literal

t3chguy added 4 commits Jun 20, 2017
…b into t3chguy/updating_stuff
…ector-im/riot-web into t3chguy/updating_stuff

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

# Conflicts:
#	electron_app/src/tray.js
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
@dbkr
dbkr approved these changes Jun 22, 2017
Copy link
Member

dbkr left a comment

Tested on windows & mac, seems to work nicely!

@dbkr dbkr merged commit fab50bc into develop Jun 22, 2017
0 of 2 checks passed
0 of 2 checks passed
continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
continuous-integration/travis-ci/push The Travis CI build could not complete due to an error
Details
@t3chguy t3chguy deleted the t3chguy/updating_stuff branch Oct 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.