{"action":"closed","issue":{"url":"https://api.github.com/repos/ledermann/unread/issues/52","labels_url":"https://api.github.com/repos/ledermann/unread/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/ledermann/unread/issues/52/comments","events_url":"https://api.github.com/repos/ledermann/unread/issues/52/events","html_url":"https://github.com/ledermann/unread/issues/52","id":79606147,"number":52,"title":"mark_as_read! not working without timeout","user":{"login":"storuky","id":11155525,"avatar_url":"https://avatars.githubusercontent.com/u/11155525?v=3","gravatar_id":"","url":"https://api.github.com/users/storuky","html_url":"https://github.com/storuky","followers_url":"https://api.github.com/users/storuky/followers","following_url":"https://api.github.com/users/storuky/following{/other_user}","gists_url":"https://api.github.com/users/storuky/gists{/gist_id}","starred_url":"https://api.github.com/users/storuky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/storuky/subscriptions","organizations_url":"https://api.github.com/users/storuky/orgs","repos_url":"https://api.github.com/users/storuky/repos","events_url":"https://api.github.com/users/storuky/events{/privacy}","received_events_url":"https://api.github.com/users/storuky/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-22T20:57:11Z","updated_at":"2015-05-28T10:23:16Z","closed_at":"2015-05-28T10:23:16Z","body":"Hello. I found a strange bug. When I execute this single-line code inside console:\r\n```ruby\r\nMessage.create; Message.mark_as_read! :all, :for => User.first; Message.unread_by(User.first)\r\n```\r\nI have this result, but it must be empty array:\r\n```ruby\r\n [#<Message:0x007f8cd8893318\r\n  id: 18,\r\n  created_at: Fri, 22 May 2015 23:52:09 MSK +03:00,\r\n  updated_at: Fri, 22 May 2015 23:52:09 MSK +03:00>]\r\n```\r\nWhen I execute this code with sleep, it works correctly:\r\n```ruby\r\nMessage.create; sleep(1); Message.mark_as_read! :all, :for => User.first; Message.unread_by(User.first)\r\n```\r\nChat - is a realtime application. It should not work so..."}}