Notifications in the electron app have completely stopped appearing. I have verified notification setting in my Zulip preferences and at the OS level and they should be coming through.
They still work from Safari and this is currently, my work-around (Safari is running logged in as well as the electron app).
Please include:
macOS Sierra 10.12.6 (beta)v5.0.1v8.0.0Put electron in background. No more notifications@GervaisdeM what version are you running?
Oops... I saw your comment in Zulip and replied there... here it is again:
I'm using the script that pull down the master branch.
git log output:
commit 7f1890d8a17aeff5e351c2ce209f7a0c0d744642 (HEAD -> master, zulip/master)
Merge: ff12b04 606e407
Author: Akash Nimare <[email protected]>
Date: Sun Jun 4 01:38:12 2017 -0700
Merge pull request #165 from geeeeeeeeek/issue/network-disconnectivity-resolution
Issue/network disconnectivity resolution
since running the above, I erased and re-cloned the entire zulip-electron repo to make sure that I didn't have anything strange in the directory. I haven't done anything locally in months ☹️
I'm now running what I know is a clean environment. I'll update here if notifications start working again.
@GervaisdeM You mean you minimized the window?
Hope it's not a bug from Electron WebView.
Sorry... didn't mean to close the issue...
I do not minimize the window, I just bring a new app into focus. ie. Put electron into the background.
:(
@GervaisdeM Sounds wired. I didn't run into this problem when I am using. I will take a deeper look tomorrow.
@geeeeeeeeek Let me know if there is anything you need from me that might help debug
@geeeeeeeeek this is happening because of the incorrect user-agent. You need to append webview's default user-agent as well. See here -
https://github.com/zulip/zulip-electron/commit/7f1890d8a17aeff5e351c2ce209f7a0c0d744642#diff-b7ea71851f2bf6f64dbcec17f174a921L137
@akashnimare Oops. I didn't find a way to append Zulip's header after web contents loaded. If this matters, I will hard code the chromium user-agent on the same line.
Maybe try -
```javascript
$webView.addEventListener('dom-ready', () => {
$webView.setUserAgent(this.systemUtil.getUserAgent() + ' ' + $webView.getUserAgent());
console.log($webView.getUserAgent());
});
@akashnimare But then the first bunch of requests (like when load chat.zulip.org) will not have this header. Different from BrowserWindow, we have to specify the url before insert WebView node into the DOM. Is it okay to attach the user-agent when dom-ready?
But then the first bunch of requests (like when load chat.zulip.org) will not have this header
@geeeeeeeeek This may cause some problems. Let's go with 'did-start-loading' event then.
@geeeeeeeeek pushed a fix in https://github.com/zulip/zulip-electron/commit/57df256a4a1c95e94ebbb3e2ed92cceb0d6de5a3. Can you cross check it?
@akashnimare sure.
@akashnimare Verified. It works.
I've pulled down the dev branch and can confirm that notifications are working again. 👍
@GervaisdeM, @geeeeeeeeek awesome. Thanks for the bug report @GervaisdeM :)