-
Notifications
You must be signed in to change notification settings - Fork 150
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
Shutdown Docker Containers when Closing Polar GUI #844
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #844 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 139 140 +1
Lines 4402 4428 +26
Branches 858 862 +4
=========================================
+ Hits 4402 4428 +26 ☔ View full report in Codecov by Sentry. |
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.
Thanks for implementing this change. This is a great feature to add.
I have some feedback after testing this locally.
- While waiting for the containers to stop, I think there should be a visual indication that the user should wait until the process finishes. Otherwise, they may think it is not working and repeatedly click the close button again. Since the
DockerContainerShutdown
is mounted at the app level, we could have a partially transparent overlay which displays a loading icon and a "Shutting down..." message. - On my Mac, the window doesn't close after the docker containers have completed shutting down. I think it's fine to remove this
if
and just make the app quit on all OS's. - The code coverage has dropped. Please add unit tests to get the coverage for the new functionality.
T
Thanks for the feedback. I would work on resolving all the points you raised |
Thanks for the updates! 👌 I noticed that if I have one network that is not started, there is still a few seconds delay before Polar will shutdown. Can you change it to close immediately if there aren't any running networks? |
Thank you for the feedback and of course. I will make the changes before the end of today. |
Hi @jamaljsr, I've got 2 blockers. I'd appereciate your help here:
Secondly, it seems my branch is out-of-date with the base branch, do I update and sync the base branch with my changes in this PR? I await your response. Thank you. |
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.
Thanks for the updates.
-
Testing can be a royal pain in the but. It usually takes me a bit of trial and error to figure out what works to target specific code blocks. Testing timers is even more tricky. It does get a little easier with experiences. The most important thing to focus on is to ensure you're verifying the correct outcomes, otherwise bugs can slip through even though you have those code paths covered.
I genuinely wouldn't have known how to help you with the tests without figuring out what works myself. So here's a git patch (network-spec.patch) you can apply and commit to your branch.
-
Yes, please rebase this branch on the latest
master
just to be sure there won't be any issues merging 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.
It looks like you merged the master
branch into this PR. It is better to use git rebase master
so your commits are placed on top of the master
branch, instead of duplicating the commits here. Just be sure your local master
branch has the latest commits from the master
branch on Github. Since this diff is pretty small, I'd be ok with squashing all of your commits into one. It doesn't make sense to have 21 commits for such a small amount of changes.
I found a couple more tweaks to make when looking at this again this morning.
b222549
to
5d5d462
Compare
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.
Thanks for fixing the commits. This is almost good to go.
Just a couple small tweaks and this will be good to go.
b29ab24
to
553e126
Compare
The code looks great! Can you just squash your commits? Then I'll merge this. |
This commit introduces a fix that ensures docker containers are gracefully stopped when the user exits the application. fix: correct comment after mod in previous commit fix: ipcRenderer import fix(test): modify electron's mock to include ipcRenderer's .on and .removeAllListeners functions feat: add shutting down indicator, add test, and make app quit on all OS by removing "if" test: add test for stopAll function fix: call stopAll without passing any param. Immediately close app when no network is started refactor: add test for stopAll dunction, moved 'shutting down...' label to en-US.json refactor: move component to common folder. Move style to Styled mappings refactor: removed an inline styling. Change key to reflect component's folder
553e126
to
a12ddf7
Compare
Done 👍 |
Thanks so much for following through with this PR. I'm going to merge it now 🎉 |
Great!. This is my first contribution to a major open source project in the bitcoin space. I learned so much. Thanks @jamaljsr. |
This commit introduces a new feature that ensures docker containers are gracefully stopped when the user exits the application.
Closes #521
Description
Steps to Test
docker ps
.