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

refactor(app): Remove notification event emitters #14504

Merged
merged 3 commits into from
Feb 16, 2024

Conversation

mjhuff
Copy link
Contributor

@mjhuff mjhuff commented Feb 15, 2024

Partially closes RAUT-990

Overview

Event emitters don't provide anything that a callback doesn't. In fact, they make things worse by:

  1. Making testing much more difficult. Mocking event emitters isn't fun.
  2. There are all sorts of emitter leak issues that can arise.
  3. The console gets spammed with warning messages.

Let's use callbacks from the IPCRenderer -> app without the unnecessary event emitter intermediary. Let's also move some of the types involving the data received from the shell layer to the proper place.

Test Plan

  • Smoke tested the app, making sure notifications work.

Risk assessment

low

@mjhuff mjhuff requested a review from a team February 15, 2024 20:33
@mjhuff mjhuff requested a review from a team as a code owner February 15, 2024 20:33
@mjhuff mjhuff requested review from koji and removed request for a team February 15, 2024 20:33
Copy link

codecov bot commented Feb 15, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (9dc8f2d) 67.74% compared to head (f3a2bb3) 67.76%.
Report is 5 commits behind head on chore_release-7.2.0.

Additional details and impacted files

Impacted file tree graph

@@                   Coverage Diff                   @@
##           chore_release-7.2.0   #14504      +/-   ##
=======================================================
+ Coverage                67.74%   67.76%   +0.02%     
=======================================================
  Files                     2517     2517              
  Lines                    72068    72055      -13     
  Branches                  9278     9276       -2     
=======================================================
+ Hits                     48823    48829       +6     
+ Misses                   21027    21008      -19     
  Partials                  2218     2218              
Flag Coverage Δ
app 64.63% <50.00%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
app/src/resources/useNotifyService.ts 84.61% <100.00%> (+48.90%) ⬆️
app/src/redux/shell/remote.ts 0.00% <0.00%> (ø)

... and 10 files with indirect coverage changes

Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We love to see it. Though maybe make those test changes that are easier?

@mjhuff mjhuff merged commit f2978c7 into chore_release-7.2.0 Feb 16, 2024
21 of 22 checks passed
@mjhuff mjhuff deleted the app_remove-notification-event-emitters branch February 16, 2024 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants