You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By clicking rapidly between messages it seems that an InvalidCastException can be raised.
Exception:
System.InvalidCastException: Unable to cast object of type ServiceInsight.ServiceControl.PresentationBody' to type 'System.Tuple`2[System.String,ServiceInsight.ServiceControl.PresentationBody]'
Exception details:
System.InvalidCastException: Unable to cast object of type ServiceInsight.ServiceControl.PresentationBody' to type 'System.Tuple`2[System.String,ServiceInsight.ServiceControl.PresentationBody]'.
at ServiceInsight.ServiceControl.DefaultServiceControl.Execute[T](RestRequestWithCache request, Func`2 selector, String baseUrl) in C:\BuildAgent\work\7540559e45164f93\src\ServiceInsight\ServiceControl\DefaultServiceControl.cs:line 280
at ServiceInsight.ServiceControl.DefaultServiceControl.LoadBody(StoredMessage message) in C:\BuildAgent\work\7540559e45164f93\src\ServiceInsight\ServiceControl\DefaultServiceControl.cs:line 168
at ServiceInsight.MessageViewers.MessageBodyViewModel.LoadMessageBody() in C:\BuildAgent\work\7540559e45164f93\src\ServiceInsight\MessageViewers\MessageBodyViewModel.cs:line 160
When CacheStyle.Immutable then the cache should contain that item directly and it its CacheStyle.IfNotModified than the type should be wrapped in a Tuple<string,T>.
The CacheStyle can be different for different instance of the same type (PresentationBody).
In this issue it is assumed that PresentationBody has cache style IfNotModified but seems to have been added as Immutable.
@ramonsmits regarding your observations after going through the code in more depth:
The PresentationBody which is what's rendered on the screen in the Body tab is only loaded through LoadBody method and it has specified CacheStyle.Immutable as can be seen here.
The reason we have both CacheStyle.Immutable and CacheStyle.IfNotModified for PresentationBody is because of messages in error queue. The messages in Success state are not going to change, hence they are CacheStyle.Immutable but error messages could be retires that's why they have CacheStyle.IfNotModified. I don't think this makes sense, since the Body of the message won't change, even if we retry it.
I still couldn't reproduce it by clicking quickly through the messages (or even by keeping arrow keys up/down). The reason this could happen is that the SI user is browsing the messages, message gets cached, then the message status changes (by either manual or automatic retrying process) and we try to pull it out of the cache with the wrong key.
I'm proposing to just stick to CacheStyle.Immutable when we load the message body (if the above makes sense).
HEskandari
changed the title
Unable to cast object of type 'ServiceInsight.ServiceControl.PresentationBody' to type 'System.Tuple`2[System.String,ServiceInsight.ServiceControl.PresentationBody]'.
Bug: Exception when switching selected failed message with a retry in progress
Mar 23, 2016
HEskandari
changed the title
Bug: Exception when switching selected failed message with a retry in progress
Exception when switching selected failed message with a retry in progress
Mar 23, 2016
By clicking rapidly between messages it seems that an InvalidCastException can be raised.
Exception:
Exception details:
Location in source code:
It seems that
CacheStyle.Immutable
then the cache should contain that item directly and it itsCacheStyle.IfNotModified
than the type should be wrapped in aTuple<string,T>
.CacheStyle
can be different for different instance of the same type (PresentationBody
).PresentationBody
has cache styleIfNotModified
but seems to have been added asImmutable
.Versions:
References
The text was updated successfully, but these errors were encountered: