Skip to content

Commit f042bbb

Browse files
committed
v9.3.9
1 parent 6f076b4 commit f042bbb

File tree

12 files changed

+1789
-2170
lines changed

12 files changed

+1789
-2170
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ init:
2020

2121
install:
2222
- cmd: echo 🔧 Setting up Node
23-
- ps: Update-NodeJsInstallation 12.6.0
23+
- ps: Update-NodeJsInstallation 12.7.0
2424
- cmd: npm --global update npm
2525
- cmd: npm --global install yarn
2626

.jsdoc.json

Lines changed: 0 additions & 40 deletions
This file was deleted.

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
matrix:
22
include:
33
- os: linux
4+
dist: xenial
45
sudo: required
5-
dist: trusty
66
group: edge
77
compiler: clang
88

@@ -36,7 +36,7 @@ env:
3636
before_install:
3737
- echo "🔧 Setting up Node"
3838
- curl -o- https://raw.githubusercontent.com/creationix/nvm/master/install.sh | NVM_DIR="${HOME}"/.nvm sh
39-
- source "${HOME}"/.nvm/nvm.sh && nvm install 12.6.0 && nvm use 12.6.0
39+
- source "${HOME}"/.nvm/nvm.sh && nvm install 12.7.0 && nvm use 12.7.0
4040
- npm --global update npm
4141
- npm --global install yarn
4242

RELEASENOTES.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
11
{
2+
"9.3.9": {
3+
"🍾 features": [
4+
"adds `msi` installer package (Windows)",
5+
"adds portable application package (Windows)"
6+
],
7+
"🚨 fixes": [
8+
"fixes multiple isses regarding application auto updates"
9+
],
10+
"👷 internals": [
11+
"upgrades internal `node_modules`",
12+
"upgrades external `node_modules`"
13+
]
14+
},
15+
"9.1.1": {
16+
"💎 improvements": [
17+
"various stability and performance improvements"
18+
],
19+
"🚨 fixes": [
20+
"migrates `electron` APIs to v6.0.0"
21+
],
22+
"👷 internals": [
23+
"upgrades `electron` to `v6.0.0`",
24+
"upgrades internal `node_modules`",
25+
"upgrades external `node_modules`"
26+
]
27+
},
228
"9.0.9": {
329
"🍾 features": [
430
"adds file-based `Notification Filter` for hiding notifications via text or regular expression pattern (https://github.com/sidneys/pb-for-desktop/issues/76)"

app/scripts/main/menus/app-menu.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,13 @@ let getAppMenuTemplate = () => {
214214
type: 'separator'
215215
},
216216
{
217-
label: `Open Log...`,
217+
label: `Show Logfile...`,
218218
click() {
219-
shell.openItem(logFilePath)
219+
shell.showItemInFolder(logFilePath)
220220
}
221221
},
222222
{
223-
label: `Restart in Developer Mode...`,
223+
label: `Restart in Debugging Mode...`,
224224
click() {
225225
app.relaunch({ args: process.argv.slice(1).concat([ '--debug' ]) })
226226
app.quit()

app/scripts/main/menus/tray-menu.js

Lines changed: 49 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const { app, ipcMain, Menu, MenuItem, shell, Tray, webContents } = require('elec
2323
*/
2424
const appRootPath = require('app-root-path')['path']
2525
const dialogProvider = require('@sidneys/electron-dialog-provider')
26+
const electronUpdaterService = require('@sidneys/electron-updater-service')
2627
const isDebug = require('@sidneys/is-env')('debug')
2728
const logger = require('@sidneys/logger')({ write: true })
2829
const platformTools = require('@sidneys/platform-tools')
@@ -133,6 +134,15 @@ let createTrayMenuTemplate = () => {
133134
configurationManager('appAutoUpdate').set(menuItem.checked)
134135
}
135136
},
137+
{
138+
id: 'simulateAppUpdate',
139+
label: 'Simulate App Update...',
140+
type: 'normal',
141+
visible: process.defaultApp || isDebug,
142+
click(menuItem) {
143+
electronUpdaterService.simulate()
144+
}
145+
},
136146
{
137147
type: 'separator'
138148
},
@@ -142,9 +152,16 @@ let createTrayMenuTemplate = () => {
142152
icon: trayMenuItemImageReset,
143153
type: 'normal',
144154
click() {
145-
dialogProvider.question('Are you sure you want to reset?',
155+
dialogProvider.showConfirmation('Are you sure you want to reset?',
146156
`${appProductName} will reset to its initial state.${os.EOL}Unsaved changes will be lost.`,
147-
(result) => {
157+
(error, result) => {
158+
// Handle Error
159+
if (error) {
160+
logger.error('reset', 'dialogProvider.showConfirmation', error)
161+
return
162+
}
163+
164+
// Handle Result
148165
if (result === 0) {
149166
configurationManager('appLaunchOnStartup').set(configurationManager('appLaunchOnStartup').default)
150167
configurationManager('appShowBadgeCount').set(configurationManager('appShowBadgeCount').default)
@@ -164,7 +181,10 @@ let createTrayMenuTemplate = () => {
164181
})
165182

166183
sessionList.forEach((session, sessionIndex) => {
167-
if (!session.clearCache) { return }
184+
if (!session.clearCache) {
185+
return
186+
}
187+
168188
session.clearCache(() => {
169189
session.clearStorageData({
170190
storages: [ 'appcache', 'cookies', 'filesystem', 'indexdb', 'localstorage', 'serviceworkers', 'shadercache', 'websql' ],
@@ -189,15 +209,23 @@ let createTrayMenuTemplate = () => {
189209
icon: trayMenuItemImageReconnect,
190210
type: 'normal',
191211
click() {
192-
dialogProvider.question('Are you sure you want to reconnect to Pushbullet?',
212+
dialogProvider.showConfirmation('Are you sure you want to reconnect to Pushbullet?',
193213
`${appProductName} will reconnect to Pushbullet.${os.EOL}` +
194214
`All unsaved changes will be lost.`,
195-
(result) => {
196-
if (result === 0) {
215+
(error, result) => {
216+
// Handle Error
217+
if (error) {
218+
logger.error('reconnect', 'dialogProvider.showConfirmation', error)
219+
return
220+
}
221+
222+
// Handle Result
223+
if (result === 1) {
197224
logger.log('reconnect', 'relaunching')
198225

199226
app.relaunch()
200227
app.quit()
228+
return
201229
}
202230
})
203231
}
@@ -324,13 +352,20 @@ let createTrayMenuTemplate = () => {
324352
type: 'normal',
325353
click() {
326354
app.focus()
327-
dialogProvider.file('Open Sound File (.m4a, .mp3, .mp4, .ogg, .wav)', [ 'm4a', 'mp3', 'mp4', 'wav', 'ogg' ], appSoundDirectory, (error, soundFile) => {
328-
if (error) {
329-
logger.error('pushbulletSoundFilePath', 'dialogProvider.file', error)
330-
return
331-
}
355+
dialogProvider.openFile(
356+
'Open Sound File (.m4a, .mp3, .mp4, .ogg, .wav)',
357+
[ 'm4a', 'mp3', 'mp4', 'wav', 'ogg' ],
358+
appSoundDirectory,
359+
(error, filePath) => {
360+
// Handle Error
361+
if (error) {
362+
logger.error('pushbulletSoundFilePath', 'dialogProvider.openFile', error)
363+
364+
return
365+
}
332366

333-
configurationManager('pushbulletSoundFilePath').set(soundFile)
367+
// Handle Result
368+
configurationManager('pushbulletSoundFilePath').set(filePath)
334369
})
335370
}
336371
},
@@ -395,7 +430,8 @@ let createTrayMenuTemplate = () => {
395430
},
396431
{
397432
id: 'showTestNotification',
398-
label: 'Show Test Notification',
433+
label: 'Show Test Notification...',
434+
type: 'normal',
399435
click() {
400436
const notification = notificationProvider.create({
401437
body: 'This is a test notification.',

app/scripts/main/windows/main-window.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,14 @@ class MainWindow {
7878
webPreferences: {
7979
allowRunningInsecureContent: true,
8080
backgroundThrottling: false,
81-
experimentalCanvasFeatures: true,
81+
contextIsolation: false,
82+
experimentalFeatures: true,
8283
experimentalFeatures: true,
8384
nodeIntegration: true,
85+
nodeIntegrationInSubFrames: true,
8486
nodeIntegrationInWorker: true,
8587
partition: 'persist:app',
88+
sandbox: false,
8689
scrollBounce: platformTools.isMacOS ? true : void 0,
8790
webaudio: true,
8891
webgl: true,

app/scripts/renderer/pushbullet/push.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const moment = require('moment')
4040
const notificationProvider = remote.require('@sidneys/electron-notification-provider')
4141
const opn = require('opn')
4242
const shortid = require('shortid')
43-
const throttledQueue = require('throttled-queue')
43+
const dynamicThrottledQueue = require('dynamic-throttled-queue')
4444
const _ = require('lodash')
4545

4646

@@ -80,22 +80,16 @@ const youtubeThumbnailEndpoint = 'https://img.youtube.com/vi/'
8080

8181

8282
/**
83-
* Notification Defaults
83+
* Notification Defaults & Globals
8484
* @constant
8585
* @default
8686
* @global
8787
*/
88-
const notificationDisplayInterval = 2000
88+
const notificationDisplayInterval = 1000
8989
const notificationIconWidth = 88
9090
const notificationFilterCommentTag = '//'
9191
const notificationFilterDebugPrefix = '[FILTERED]'
92-
93-
/**
94-
* Notification Globals
95-
* @constant
96-
* @global
97-
*/
98-
const notificationQueue = throttledQueue(1, notificationDisplayInterval, true)
92+
const notificationQueue = dynamicThrottledQueue({ min_rpi: 1, interval: notificationDisplayInterval, evenly_spaced: true })
9993

10094

10195
/**

app/scripts/renderer/webviews/pushbullet-webview.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ let addWebsocketEventHandlers = () => {
277277
if (!(pb && pb.ws && pb.ws.socket)) { return }
278278

279279
pb.ws.socket.addEventListener('message', (ev) => {
280-
logger.debug('pb.ws.socket#message')
280+
// logger.debug('pb.ws.socket#message')
281281

282282
let message
283283

@@ -288,6 +288,8 @@ let addWebsocketEventHandlers = () => {
288288
return
289289
}
290290

291+
logger.debug('pb.ws.socket#message', 'type:', message.type)
292+
291293
if (message.type !== 'push') { return }
292294

293295
/**

0 commit comments

Comments
 (0)