-
Notifications
You must be signed in to change notification settings - Fork 91
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
Verify serialization of all events #269
Comments
- This fixes some of the events that was not shown over Web Socket. - Related to the #269 issue.
I am not sure this is a good idea, this will slow down the sync for sure when the wallet has many trx. |
Whats the problem with serialization? why is i not working? |
- Avoid calling ToHex and ToString (ID) in the constructor. - Calling the ToString to get ID only in the get method, which means it will only be called during serialization or upon request. - Related to #269
The problem is that Transaction does not serialize to JSON during the Web Socket send event, and that type of issue does not trigger exceptions, so it's hard to discover. You simply don't get events out from SignalR. I have not tested all events yet, so we'll keep this issue open until all events has been verified to work properly. The recent commit improves performance by lazy-getting the transaction ID, and the hex we won't return in the events. That is something that the consumer can request in separate call. |
ah right right in that case I think maybe we don't propagate the eventbus types to signalR or just what you did is fine. |
@sondreb it's not strictly an improvement because if multiple part listen to that event and ask for the lazy loaded implementation, your implementation load it twice, that's not the proper way to lazy load. Also a couple of observations:
P.S. |
- The Transaction ID on events won't be calculated multiple times in cases where the same instance is serialized twice. - Related to #269
We're utilizing the I still went ahead and optimized it further with a lazy loaded property. in the commit above. There is zero usage of this Web Socket event API at the moment (at least for the events in question here), so it's hard to know how it would be best to extend or improve the entities. Need more user feedback to consider additional improvements. One important optimization would be to configure the interval for different events, so you don't get e.g. staking info too often. But not worth spending time on that until we actually have users and issues with too many messages. This was a quick bug fix so didn't consider doing it as PR, but it's probably on border-line change that it could have been a PR. |
ok that's a proper lazyload Anyway my consideration about having lightweight event types is that they are public events that can be used by 3rd party and you cannot foresee their usage.
ok that's an implementation detail of the signalr feature, may be a valid point, I don't have seen its implementation yet |
The SignalR implementation is not able to properly serialize all internal events in Blockcore. I'm fixing the Transaction ones, but this is another one that might fail:
This should be further investigated and verified.
The text was updated successfully, but these errors were encountered: