-
Notifications
You must be signed in to change notification settings - Fork 34
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
API returns nothing even though WS says something new is created #829
Comments
This is just a function of the lifecycle of objects in the MS database. Websocket messages are sent based on certain events, but they can't necessarily be taken to mean "this is available right now" - they usually mean more "this is being processed now". |
This piece of information is generally not useful for applications. What applications listening to the websocket wants to know is when some resources becomes available, so they can go ahead and request for it by API. Otherwise, applications still need to fallback to polling the API for data, which defeats the whole point of metasmoke's websocket. What looks like a bug to me is that in app/models/concerns/websocket.rb line 7 [1]: maybe |
While I have not 100% verified it, from what I've seen, the WebSocket can and does provide, if you correctly configure your end, a complete record of the item which is being created or updated. Trying to also fetch it from the MS API is a redundant waste of bandwidth and compute capability. The WebSocket exists, not to just tell you that "this is now available for you to fetch it from the MS API", but to give you the information, so that you don't need to fetch it from the MS API. |
That is probably true, but if one wants to get additional information they will be out of luck. My particular use case is once a new feedback is announced by websocket, I go and fetch all feedback for the post, so that there is no need for me to keep a local db or similar in order to track all feedback for a post. With ws not synchronized with API, I often get the same list of feedback as before. |
Sometimes, after MS websocket says that a new post or a new feedback is now available, API is still returning nothing for the resource identified in WS message. I have tried to increase the delay between receiving WS message and querying API, but even at 5 seconds of delay, there are still some instances (about 3%) that API returns nothing.
This issue is also seen in Halflife. Halflife issues a message with tag [skipped] after getting nothing from MS API (search). There is an issue currently open in Halflife repository saying that Halflife is skipping too many posts. However, I think this might be a bug on MS side.
The text was updated successfully, but these errors were encountered: