• I have a real time news feed that keeps updating via websockets
  • Lets say you went to the search bar and typed new york
  • I will fetch all 'new york' related articles from the database
  • But since I am also connected to websockets, when the news sources that I scan change, I push new data items to each connected client
  • How do I handle this?


  • Should I block the updates?
  • Should I only show 'new york' related new items?

Apart from the technology involved, A user expects robustness and concurrency from the interface (where the search is initiated here). So to say, updating main page via web socket with new data sources is acceptable but trying to update the search result user already looked is not something desirable in this case since the user not necessarily have to turn back and look at the same page or place again without being aware of it.

Like stack exchange and many other sites also covering this issue as a feature, you might want to overcome this with a notice at the top of the page above. I don't have a chance to take a screenshot now (I'll do whenever I can) but if you stare a newly asked question for a while, you'll notice it whenever someone submits an answer before you do. It basically blurs a line with grey (I suppose), and notifies about some other one's answer also exists and asks you if you want to refresh the page (showing answer in this case) or not.

The implementation of this method may vary but, giving the user a chance to realize that the search data has refreshed and if he/she would like to access it would be the best solution here.

And for your last question, if you're in the main page you may prefer to do this method or not but if you're in the search results page, then you should ask for displaying the new search results, not others for sure. Showing sources other than search results doesn't make a sense but you should also refresh other data whenever user moves from the search page.


I just could take a screenshot of an example situation below on stack overflow. You may ask for more if you need.

enter image description here


I think most users don't expect their search results to change in real-time — that almost sounds like a separate feature (like subscribing to a topic).

The flow I'd expect is that searching is a one-off operation which returns a set of static results, if you want up-to-date info then the user needs to perform the search again (think Google).


Yea, you don't want to interrupt a search that has already been launched. But you might want to highlight the continually updated nature of your search by displaying a small message or alert at the top of the SRP, something that says, "New results found, search again?"

Instagram and Twitter display similar messages for an updated feed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.