SG-17861 Fixes an error that gets thrown when leaving a project on OSX.#120
SG-17861 Fixes an error that gets thrown when leaving a project on OSX.#120
Conversation
It seems it errors if the connection gets closed mid loop.
Codecov Report
@@ Coverage Diff @@
## master #120 +/- ##
==========================================
+ Coverage 15.24% 15.28% +0.03%
==========================================
Files 68 68
Lines 4533 4554 +21
==========================================
+ Hits 691 696 +5
- Misses 3842 3858 +16
Continue to review full report at Codecov.
|
|
I looks like there are some other errors thrown at other stages such as if you press back whilst loading a project or if you close desktop whilst loading a project. I'll make those part of this PR so actually hold off on the review for now. |
This will currently mean that the tests fail, but I need to fix the cause of the failure.
jfboismenu
left a comment
There was a problem hiding this comment.
Looks fine, but the Python 3 build is broken.
tests/test_rpc.py
Outdated
|
|
||
| class CaptureErrorServer(RPCServerThread): | ||
| """ | ||
| This is the RPCServerThread but it captures any errors |
There was a problem hiding this comment.
yeah I like it as well but as per our discussion I'll remove it, as we are not going to go and fix the issues it is raising right now in the tests.
It did actually however prove that my fix worked.
There was a problem hiding this comment.
OK I've actually left it in and commented out the raising. How do you feel about that?
Would you prefer me to remove it entirely. I feel by leaving it in there we are drawing attention to the fact that we are not capturing the errors from the server and providing a solution that could be enabled when we are ready to deal with the errors.
another approach I guess would be to remove the class but just leave a TODO with the link to the SO answer that gave me the solution.
There was a problem hiding this comment.
Well, if you have inspired the code from something you saw on StackOverflow, you are legally required to include a link. All posts on StackOverflow are done under the Creative Commons license. It requires that any piece of code you reuse or adapt is given attribution by providing a link to the required post.
I also just learned that you need to mention if the code was modified or as is. I've generally been using the following formulations: "This code has been lifted" vs "This code has been inspired by".
There was a problem hiding this comment.
I'd rather put a comment in the code itself with a FIXME saying that a exception can be raised from here, so the next person who needs to fix this can do it can find the place to fix right away. What do you think?
There was a problem hiding this comment.
AH OK I didn't know about the inspired by bit, but I did have the link in there.
I have a TODO which I could rename to FIXME, are you saying just have a comment/FIXME with the link and remove the class entirely rather than just commenting out the raise bit in the class?
There was a problem hiding this comment.
From my understand the class is not used. Instead of leaving a test class with some magic code in it, let's document the actual class with its shortcoming. Does that make sense?
can be reimplemented when we are ready to fix it.
|
I've changed the approach again. Francis was getting a different error than originally reported when testing this. And when I went back to test it I was getting this different error as well, and I couldn't reproduce the originally reported error. What do you think? |
This reverts commit 048fe06.
When you leave a project (after fully loading) in SG Desktop on OSX you get the following error in the console (but not in the logs):
It seems it errors if the connection gets closed mid loop, then the
select.selectcall will error if the listen object is closed.I'm not sure if this is the right way of going about handling this.