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

InvalidCastException In Communicator #2

Open
OriNachum opened this issue Aug 11, 2019 · 4 comments
Open

InvalidCastException In Communicator #2

OriNachum opened this issue Aug 11, 2019 · 4 comments

Comments

@OriNachum
Copy link

I got an exception today when trying to get GetStateAsync.
I asses this happend due line 75 in Communicator.
Will take further review later on.

Relevant part of stacktrace:
System.InvalidCastException: Unable to cast object of type 'Lifx.Communication.Responses.Payloads.ResponsePayload' to type 'Lifx.Communication.Responses.Payloads.StateResponsePayload'.
at Lifx.Communication.Communicator.CommunicateAsync[TResponsePayload](Request request, CancellationToken cancellationToken)
at Lifx.Light.GetStateAsync(CancellationToken cancellationToken)

@OllieDay
Copy link
Owner

Did this only occur once or are you able to reproduce it?

@OriNachum
Copy link
Author

Will try and reproduce.
Also having trouble using OnAsync/OffAsync/SetPower with duration and investigating this.
I don't mind closing and re-open if I encounter it again

@OriNachum OriNachum reopened this Aug 12, 2019
@OriNachum
Copy link
Author

I'm able to reproduce on debug. Maybe it's .net core issue?
I suspect it's an issue with multiple requests and async-await issue.
I'm able to reproduce intermiteddly (I scan my network for lights, and then send a on/off request to one of them)
Also, I put debug on Request.GetData return line (190)

@OllieDay
Copy link
Owner

I wasn't able to reproduce this exception using a .NET Core console application. I've opened issue #3 for the duration parameter not working.

@JasonPulse JasonPulse mentioned this issue Aug 6, 2024
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

No branches or pull requests

2 participants