-
Notifications
You must be signed in to change notification settings - Fork 15.7k
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
feat: full support for persistent HTML5 notifications #35810
base: main
Are you sure you want to change the base?
Conversation
For additional information see previous pull request #34671 |
a1a4358
to
a3c635c
Compare
Hello Electron team! |
The error isn't saying "make it const" it's saying either it should be a const reference, or it should be passed as a pointer. This comes from the google style guide which we inherit and follow. Basically if an argument is an "input" to a method it should be a const reference, if it is an "output" as in your case (it is modified as a result of the call) it should be a pointer. In your specific case to avoid useless vector construction you could also just make the signature of the method |
Hello @MarshallOfSound ! |
@YuriL180821 I am not saying this is a rule of C++, I am saying this is a rule of Googles C++ styleguide. It is an opinionated decision but a decision nonetheless. We abide by the styleguide, if your code does not it will not pass CI and can not be merged |
1182cae
to
01196a6
Compare
3e1f76f
to
433139a
Compare
ea4f568
to
3f3af3b
Compare
Hello @MarshallOfSound I have strongly point of view that last changes in repo from Community which were merged have problems, please compare my few days old MR and MR after upgrade branch today Regards, |
@YuriL180821 Per the CI dashboard the test that failed on |
Hello @MarshallOfSound ! Thank You for the update, but I do not understand what I have to do with this MR. As I told : my MR did not bring any changes on MacOS or Linux and in current configuration is pure Windows related feature. I'm expecting on consideration last changes and in case if ok expecting merge of them. After that I'm going to create separate pull request with changes on MacOS. If into few words : I'm trying to deploy feature into 2 steps: Win and than MacOS related functionality. Regards, |
@YuriL180821 I don't believe either mine nor @zcbenz 's comments from the original PR have been appropriately addressed. Given this is a new PR I will transpose the comments this week to ensure you have a clear picture of what I consider still needs adjustment. Quick thing right now is the |
@MarshallOfSound, ok I will provide extra review for comments into my codebase. |
Hello @MarshallOfSound I did clean up for SAP- related comments. 2022-10-12-13-07-27.mp4 |
2f0a55c
to
d9fbdc6
Compare
@@ -601,7 +632,7 @@ Hides all application windows without minimizing them. | |||
|
|||
### `app.isHidden()` _macOS_ | |||
|
|||
Returns `boolean` - `true` if the application—including all of its windows—is hidden (e.g. with `Command-H`), `false` otherwise. | |||
Returns `boolean` - `true` if the application-including all of its windows???is hidden (e.g. with `Command-H`), `false` otherwise. |
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.
Heads-up: A lot of the special characters here seem to have been changed to ???
!
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.
Hello @felixrieseberg thank you for the remark.
Honestly due to continuous work of community into notifications module my branch becomes conflicting, and I have to resolve conflicts, sometimes in parts which are not related to notifications at all, this is a result of one of such resolving. Maybe I missed this moment, will take a look when have enough time.
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.
Hey @YuriL180821, thanks for your submission! I'm glad CI went green - however, it looks like there are still some issues from previous reviews that need to be addressed. I left those as specific comments below - let me know if you have questions and we can re-review after the comments have been addressed.
One issue in particular I wanted to call out: right now, the PR is written with the assumption that a process id only has one web contents. I realize this may not be a simple refactor, but I don't think we'll be able to merge the PR unless this is changed. Let me know if you have specific concerns and we can try to address them.
content::WebContents* web_ctx = | ||
browser_client_->GetWebContentsFromProcessID(proc_id.value()); | ||
if (!web_ctx) |
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 believe @MarshallOfSound called this out in an early review, but I don't think this implementation is going to work - this assumes there is only one web contents per process ID, which may not be the case. Could we refactor this to account for multiple web contents per process id?
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.
Hello @VerteDinde thank you for the remark.
It works fine. Honestly it is too time consuming for me to repeat things from previous discussions. Persistent notifications come from ServiceWorker which in it's turn has last NotificationContext. Internaly we store pointer on it and than by function call try to find with usage of pending process list. Process with pointer on this context is right place for notification. This is our huge difference with non-persistent notifications for which we have exact process. You can believe me or not, but in case if somebody told me the similar at least I would try to understand developer who made everything almost two years ago.
I would say more - we can use same approach and for non-persistent notifications and exclude Electron patch for Chromium in
void PlatformNotificationService::DisplayNotification( content::RenderFrameHost* render_frame_host, const std::string& notification_id,
As far as I remember content::RenderFrameHost* render_frame_host, was added by through chromium patch.
And in my vision this is not too good conceptual solution. We do need any patches, just use my approach above and for non-persistent part.
Be sure I had enough time into Debug mode to understand some not obvious things :)
Regards.
@@ -1555,6 +1561,27 @@ std::string App::GetUserAgentFallback() { | |||
return ElectronBrowserClient::Get()->GetUserAgent(); | |||
} | |||
|
|||
#if BUILDFLAG(IS_WIN) | |||
// SAP-15762: Support COM activation registration at runtime |
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.
These SAP comments need to be removed
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.
Time to time I have to resolve MR conflicts or need to add new functionality and sometimes potentially can miss internal comments which I did for my company. I will take a look when have enough time.
std::string App::GetBrowserClientNotificationsComServerCLSID() { | ||
return ElectronBrowserClient::Get()->GetNotificationsComServerCLSID(); | ||
} | ||
// SAP-21094: Application name displays in incorrect format on notification |
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 won't comment on each of these individually, but there are 5-6 places where SAP-XXXX
is commented - can you remove those please?
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 absolutely no need to comment all SAP comments, I will fix this
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.
Hi @YuriL180821, I wanted to see if you'd be interesting in continuing to move this PR forward. I can bring it up to be discussed within the Electron API Working Group. Please ping It looks like there's some more work to be done around cleaning up code comments and possibly gaining more consensus around certain implementation details. |
@YuriL180821, you did amazing work here – can you help push it over the finish line? |
Description of Change
1.Full support persistent notifications
2. Fix for the #13041
3. Full support HTML5 notifications functionality according to spec https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API including support for newly added properties:
6. Double application registration(MacOS) for correct support behavior for Alerts and Banners7. XPC Alert service integrationChecklist
npm test
passesRelease Notes
Notes: This pull request introduced previously absent functionality for persistent notifications and brings support for such properties as
For additional information see previous pull request #34671