-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Fix: notifications (fix #88, fix #956), processEnvs, using as git #955
Conversation
@exander77 hi, thanks for the contribution. Please elaborate: what was broken? |
A constructor cannot be a lambda function, so this completely broke |
I have traced it back to 2016, to see what happened:
|
@exander77 okay, so the symptom was that notifications were broken, and you tested that re-building with this change fixes them. Correct? Good to know, I didn't know about that. Reading more about it, e.g. in SO / Why cannot use lambda to define prototype function. |
@ronjouch Yes, I was debugging why are they not working. Also, the code was previously there, so I am basically reverting. Btw, lambda is not just fancy name how to write functions. It is a concept derived from Lambda Calculus, where you create ad hoc anonymous functions. Constructors are named and they are bound to instance because they have access to this, lambda, on the other hand, is accessing this of the parent closure. Also in the future, those lines should be completely rewritten to TypeScript. I may do it. A side question, why is this code in preload and not main, what is the logic there? Btw, please merge it soon, as this fixes things for a lot of apps and users. I may be making more pull requests, I just found out processEnvs seems to be broken as well. I am getting: |
Updated with more fixes. I am using these two days and based on my experience so far, you guys tend to rewrite code and break it for no reason and probably not even test. I think this is a good project, but this type of development hampers the usefulness. |
6e5ccb5
to
04bdeff
Compare
…eaking compatibility introduced
Awesome.
No idea.
Yup, I'll merge & release this as soon as I can review and test it.
Fixes and improvements welcome; see recent announcement asking for help.
Your improvements are welcome, but your focus on blaming people, lecturing attitude, and idealistic context-less comments full of unmet assumptions, are not welcome.
I hope you're able to reconsider what you said, can appreciate what I wrote above, and can present excuses. Your comment made me angry on a Sunday morning and that's not what I want from a contributor. |
I have seen multiple emails in the commit history, hence "guys". Breaking of Notifications is from 2016, not related to Revamp. Don't take it personally, it is not an attack or anything like that, it is more of frustration from debugging problems. I complain a lot about things... but do not take me so seriously! It is not meant in a bad way. I have seen the history and I know a Revamp was a large piece of good work! I went through a lot of old commits to see how the project evolved and where the breakage come from. You are right, that I am not focusing on positive things much. This is because it seems obvious I like the project and instead of abandoning it after problems, I will try to fix problems when I find them. What I am looking now at and I would appreciate any input is:
I really think this is a good project. And I am sorry for making you angry, don't be. Just ignore me, If I am complaining too much... |
@exander77 thanks for the acknowledgements an excuses 🙂. To close on that, take this little clash as a reminder that there are sometimes good reasons for the state you find code (or society?) in. Then, if/when frustration about the current state starts boiling up, remember to make less assumptions and ask questions before criticizing. I don't want to ignore you, I'm grateful for your contributions. Now, back to the problem:
Hmmmmm arguments passed to which actual program? Are you talking about build-time args? They're processed, massaged in several ways, and persisted to a
No sé. Search in the Electron docs, maybe in library code, and make a few Google searches. 👍! Please append
Can we recap together the current/expected behavior?
So, right now, users might assume they're "disabled by default" (except they're just broken 😄). So your code could "keep them disabled" by default, with an Thanks! |
Thank you for understanding! I am talking about when you call the actual binary built by nativefier with some arguments: I will go through the bug reports and tag all appropriate to the PR. Yes, exactly, the sudden appearance of notifications after so many years may negatively surprise users. :D |
package.json
Outdated
@@ -42,6 +42,7 @@ | |||
"lint:format": "prettier --write 'src/**/*.js' 'app/src/**/*.js'", | |||
"lint": "eslint . --ext .ts", | |||
"list-outdated-deps": "npm out; cd app && npm out; true", | |||
"prepare": "cd ./app && npm install && cd .. && npm run clean && tsc --build . app && npm run build-app && npm run build-app-static", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"prepare": "cd ./app && npm install && cd .. && npm run clean && tsc --build . app && npm run build-app && npm run build-app-static", | |
"prepare": "npm run dev-up && npm run build", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try, but npm install is actually run automatically when you install it as a dependency. I am not sure if it is wise to interfere with it as npm run dev-up calls it as well, but npm run build should be safe I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to cd ./app && npm install && cd .. && npm run build
. When I go full npm, it is going into some kind of cycle. I think, when you call npm install, it will call prepare, and then prepare will call install etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather keep the separate tasks we have, then, your prepare
task is confusing, as it only npm installs the app. The current tasks are find and documented in https://github.com/jiahaog/nativefier/blob/master/docs/development.md :
dev-up
for initial npm installs of cli and app- then
build
to build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh okay, I'm reading the updated PR description where you say Fix: package.json completely missings prepare (or even prepublish) which breaks using as git dependency
. Alright.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ronjouch This is not my task at all. This a task required by npm to able to use dependency from git: https://docs.npmjs.com/misc/scripts
If you specify main
and bin
in your package.json, you need to have those files there after npm itself calls these on the dependency:
npm install
npm run prepare
This is also why I cannot put npm install in the prepare, as npm which is also calling it will run into infinite cycle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@exander77 got it, see my comment above:
Oh okay, I'm reading the updated PR description where you say
Fix: package.json completely missings prepare (or even prepublish) which breaks using as git dependency
. Alright.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I am updating it with new info. As I understand it, when you add a dependency from git, npm calls this on it:
npm install
npm run prepare
And then checks if main and all bin are there and fails completely if they are not there. :(
LGTM. If you can, a separate PR will be welcome, I like commits documenting and working on one thing, it makes for easier history digging & bisection. @exander77 I can already merge the current PR. Is it ready, or do you have other things close by you want to add? |
@ronjouch Yes, merge it, please. This should be a small PR with fixes. |
I just discovered this project one hour ago, built an app for Google Calendar, noticed that the notifications are not working then found this. I'm glad that this issue got addressed and getting fix soon™️! I cannot wait for building more apps! Keep up the good work! (I'm commenting here to get notified once this is merged.) |
@pgrenaud When it is merged, give us a notice if everything is going ok for you! Also, I think you can check out a pull request locally and test it if you want to: |
Thanks @exander77. Tell me if you have new stuff brewing and ready soon, I'll either release this soon or wait for your new stuff. |
@ronjouch I will add PR with notification switch soon, hopefully by the end of this week. |
Hi everybody,
That is not correct. Notifications worked with nativefier 7. I created the same app with the exact same settings with v7 back in February and another one after an update to v8 just now. The first has notifications working the other one doesn't. Nevertheless, it is broken now and good thing @exander77 fixed it. :) |
@schloram Version 7 was released in 2016. The commit which broke it is dated 2016. So you were using a version which was not affected yet. |
I was actually using Nativefier v7.7.1 released this on 24 Jan. 🤔 |
Hey @exander77! I never got back to you. It's been more than 2 weeks that I've been using the 2 apps I build with your fixes and they are working great! No issue so far. Thanks again. |
Is it working for you guys? For me it's still the same behaviour 😢 |
Still no notifications here on Linux using KDE. |
Same here. But I figured that for some applications notifications work (e.g Whatsapp) and for others it doesn't (e.g 3CX). Could this be because of the different implementation of browser notifications of these apps? @needo37 @adshrc Which websites don't show applications for you? And do Whatsapp notifications work properly for you? |
For me it's not working with Asana. But Google Chat works! I'm doing a little research - it definitely depends on how the app is handling Notifications. Asana replaces the native |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
MacOS notifications not working with nativefier 11.0.2 and outlook365 portal.
My script to create Outlook app, but no native OS notifications so far. |
…vs, using as git (nativefier#955) 1. Fix (broken since 2016): Notifications broken by lambda constructor 2. Fix: `--processEnvs` broken by additional processEnvs object, the result was: `processEnvs: {processEnvs: {...}}` which caused the conversion of the inner object into string `[object Object]`, no nesting allowed there probably. Compatibility introduced. 3. Fix: package.json missing `prepare` (or even prepublish), which breaks using as git dependency.
--processEnvs
broken by additional processEnvs object, the result was:processEnvs: {processEnvs: {...}}
which caused the conversion of the inner object into string[object Object]
, no nesting allowed there probably. Compatibility introduced.prepare
(or even prepublish), which breaks using as git dependency.