Skip to content
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

mark_as_read! not working without timeout #52

Closed
storuky opened this issue May 22, 2015 · 2 comments
Closed

mark_as_read! not working without timeout #52

storuky opened this issue May 22, 2015 · 2 comments

Comments

@storuky
Copy link

storuky commented May 22, 2015

Hello. I found a strange bug. When I execute this single-line code inside console:

Message.create; Message.mark_as_read! :all, :for => User.first; Message.unread_by(User.first)

I have this result, but it must be empty array:

 [#<Message:0x007f8cd8893318
  id: 18,
  created_at: Fri, 22 May 2015 23:52:09 MSK +03:00,
  updated_at: Fri, 22 May 2015 23:52:09 MSK +03:00>]

When I execute this code with sleep, it works correctly:

Message.create; sleep(1); Message.mark_as_read! :all, :for => User.first; Message.unread_by(User.first)

Chat - is a realtime application. It should not work so...

@ledermann
Copy link
Owner

Hm, I just pushed a fix for a memoization issue, which can be a fix for your issue, too.

But: Is your code above real code? Using User.first all the time should avoid memoization problems in general, so my fix doesn't change anything for your issue. Please: Check again with the master branch. If your issue still exists, it would be helpful to get a failing test.

@ledermann
Copy link
Owner

It seems the real fix was made in #51. Please upgrade to v0.6.1.

ledermann added a commit that referenced this issue May 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants