-
Notifications
You must be signed in to change notification settings - Fork 49
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
Make Response Exception work #297
Make Response Exception work #297
Conversation
… more than one Receiver if appropriate
…at timer and wrote a test for it
make Channel Loggers to pick up the according receive messages.
- got rid of stic TestHelper (didn't really help) - shutdown client in all Media Channel tests to keep device in idle(?) -> this helped!!!
(really use task completion object to Enter the Exception in await task)
You are talking here about LOAD_ERROR and then you added a class called LAUNCH_ERROR. |
Yes, sorry its a 'LAUNCH_ERROR'. I read my own wrong commit comment here... This error happens when 2 different Clients try to make LaunchApplicationAsync with different AppIDs. One gets the expected ChromecastStatus as answer, and the other one - before the fix - never gets an answer and times out on the await. |
Here is a log of this case before the fix. There the other AppID is loaded but normally - if no other client tries to reconnect - the LAUNCH request would be answered with a ChromecastStatus containing the new Application launched. Here the LAUNCH_ERROR never triggers anything and the test timed out (showing status and making ping/pong to the 'old other APPID' .... After the fix I do get an exception on the await LaunchApplicationAsync, which is the correct thing to have in this case.
|
Thanks for the reply. Now it makes sense and it's great to get those error cases fixed. I noticed that there wasn't any logic to handle load media errors either when researching on this. Can you resolve the conflicts. I will merge this after that and release a new version. |
What I am not sure now is if the channel logic is consistent now. On the receiver Channel I was perfectly happy with the 'Cannot cast received message X to expected message Y Exception' generated by the receive loop. I did not really dive into all of the inheritance with the "StatusChannel"s vs "normal channels". |
I agree with that. Also since there is very minimal documentation the most important thing is that there is test case showing it. So I'm very happy with the current status |
Ok, I think this code is good to go. I checked it with a local built package and all my applications (with and without Logging) work like a charm ... |
Are your applications open source? I was finally planning to write a new sample application and thinking a bit of what I would like to do with it |
I do them in a public repos here: https://github.com/RobertK66/HomeAudio , but it is far more undocumented than your code here and I am not really prepared to give a lot of support over there. This is more of a playground for me to experiment with stuff ( Win UI3 - sort of works/ Consolen GUI . thats it / Avalon not anything coded there / ... ) at this time. The ConGui Project there is the one that serves my home office/JBL Speaker since i abandoned my first WPF implementation after years of using that (I think this was available open source somewhen in my fork of your sharpcaster repos years ago....) |
Thanks for the link. I will take a look at AvaloniaUI and probably create a sample using it since I haven't done anything with it yet and it seems nice |
What I did:
again a lot of refactoring's in the Tests.
the main thing I found was that a LOAD_ERROR never canceled the correct Task waiting for its TaskCompletionSource. The reason was that the 2nd call of TaskCompletionSourceInvoke() did not find the tcs because the 1st call already removed it!
(unfortunately I can not provoke this with a unittest. It needs my device to be connected to my current HomeAudio Client which tries immediate to reconnect on receiving of a disconnect. This is a synchronized load_App from 2 different clients where my unittest then gets the LOAD_ERROR with reason 'CANCELED'.
some adaption of the ChannelLogging. Now also receive Trace is logged on the Channel._logger. I think this is more consistent now