-
Notifications
You must be signed in to change notification settings - Fork 32
response payload mismatch between websocket monitor response payload #42
Comments
two things:
|
The main issue is when the payload schemas are different between API call response and websocket messages. I don't think it really matters about the names as long as they are consistent. |
|
It's crucial to understand, that what is reported via REST apis is a STATE not transactions, so i.e. there's: I'm not sure if it's a good idea to make both of these the same. |
To be more specific: If mongodb has 'action' instead of 'linkAction', then the websocket payload will return different payload I'd thought?? |
mongodb data is exposed directly to the REST API as json, websocket data comes from the server, not mongodb |
Then it's a bit of pain on the SDK as RESP repos and ws are sharing the same serialisation / serialisation code, that's the root cause of the issue. IMO, we should expect consistent transaction schema from the REST, as SDK won't talk to server directly. |
well but this is what gimre is saying, even though in both cases we are talking about transactions, for the REST API (MongoDB), this is state, and the WS return deserialized transactions - even though it is conceptually the same, they are treated as different type entities, and the SDK seems to be trying to use the same schemas for both of them |
🤔 Lower level implementations like the SDK shouldn't care the origin of the data source. Payload format on the 'same` entity should be consistent. Although they are conceptually different in terms of their origin, but they are the same from the output point of view, and they both get mapped at the REST level. Majority of the fields in transactions are all matched, I don't see a reason why this field cannot be matched? Thinking about not only the SDK, other implementations will also face the same issue. I don't think it's user friendly. |
|
after discussion on slack, changes that will be done to mongodb mappers (this might affect rest schemas):
|
Symptom
Rest response payload mismatch between websocket monitor response payload e.g.
transaction confirmed
and Rest endpoint response payloadaccount/{publicKey}/transactions
.Example (AccountPropertyAddress Transaction):
modificationType
inside modifications arrayaccount/{publicKey}/transactions
usestype
Affect:
modificationType -> type
actionType -> type
actionType -> type
actionType -> type
The text was updated successfully, but these errors were encountered: