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
In the thunder_ripple_sdk there are a few places where a response from Thunder is assumed to be of a certain shape. This assumption is relied on to parse and deserialize the data in the response from Thunder. This means that if the response is not the expected one there is a panic which crashes the Thunder extension.
For example in device/thunder_ripple_sdk/src/processors/thunder_device_info.rs:
let resp = state
.get_thunder_client().call(DeviceCallRequest{method:ThunderPlugin::System.method("getSystemVersions"),params:None,}).await;// FIXME: if the thunder plugin does not respond then we panic on the unwrap here. This would be a problem if the Thunder System plugin was not loadedinfo!("{}", resp.message);let tsv:SystemVersion = serde_json::from_value(resp.message).unwrap();
The unwrap on the last line of the example is the problem. There are two cases that we need to account for when receiving messages from Thunder:
Handle JSON-RPC errors. Error responses form part of the JSON-RPC spec and we should be handling them properly.
Responses which do not conform to the expected shape For example, if a Thunder plugin adds fields or removes fields from a JSON-RPC response we should be able to handle it more gracefully.
The text was updated successfully, but these errors were encountered:
In the thunder_ripple_sdk there are a few places where a response from Thunder is assumed to be of a certain shape. This assumption is relied on to parse and deserialize the data in the response from Thunder. This means that if the response is not the expected one there is a panic which crashes the Thunder extension.
For example in
device/thunder_ripple_sdk/src/processors/thunder_device_info.rs
:The unwrap on the last line of the example is the problem. There are two cases that we need to account for when receiving messages from Thunder:
The text was updated successfully, but these errors were encountered: