This issue is not always reproducible, but the data coming in from the API or the real-time data from the WebSocket is sometimes undefined inside the object itself, which needs to be correctly handled in the interface for the DTOs in the TypeScript.
What I mean by that is we have some DTOs that look like this:
If we look closely, collateral_return: Object; this property expects the Object as its data type, and we can have anything inside this. So, these interface and property data types might likely be the root cause for these exceptions.
Solution
[ ] Properly define the DTOs and their properties and handle them gracefully.
This issue is not always reproducible, but the data coming in from the API or the real-time data from the WebSocket is sometimes undefined inside the object itself, which needs to be correctly handled in the interface for the DTOs in the TypeScript.
What I mean by that is we have some DTOs that look like this:
If we look closely,
collateral_return: Object;
this property expects theObject
as its data type, and we can have anything inside this. So, these interface and property data types might likely be the root cause for these exceptions.Solution