kandanapp / kandan

Kandan is an Open Source Alternative to HipChat
GNU Affero General Public License v3.0
2.72k stars 407 forks source link

Some people are randomly reconnecting every couple seconds #331

Closed alexhulbert closed 10 years ago

alexhulbert commented 10 years ago

I've noticed that a few people's statuses are flickering between connected and disconnected. It gets really annoying, since half the chat log is filled with

/-------------------------------------\
| Person Connected      1 Minute Ago  |
|-------------------------------------|
| Person Disconnected   1 Minute Ago  |
|-------------------------------------|
|  OtherPerson:                       |
|      Hello, how are you?            |
|-------------------------------------|
| Person Connected      56 Seconds Ago|
|-------------------------------------|
| Person Disconnected   43 Seconds Ago|
|-------------------------------------|
| Person Connected      36 Seconds Ago|
\-------------------------------------/

The weird thing is that this happens a couple times a day in hour-long periods of time. Not only that, but even after suspending the user, it continues to go on.

scouttyg commented 10 years ago

Are these people you can ask questions to? What I mean is --- sometimes Faye breaks and there is something in the Chrome console that will end up logging some sort of error -- if we could figure out what error was happening, that would be helpful.

PythEch commented 10 years ago

It looks like this issue is related with this: https://github.com/kandanapp/kandan/issues/270#issuecomment-40008743

I can confirm that I don't have an auth_token on @Triforce1 's server.

New users have an auth_token though.

scouttyg commented 10 years ago

The fix I created should have included a migration file that loops through the users to make sure that they have an authentication token (see: 20140409193213_fix_authentication_tokens.rb). This basically resaves all the users. which should call before_save :ensure_authentication_token which is defined as:

  def ensure_authentication_token
    if self.authentication_token.blank?
      self.authentication_token = generate_authentication_token
    end
  end

Which will generate auth tokens if you don't have them. Was this an old version of Kandan that didn't have this update?

PythEch commented 10 years ago

Probably, I don't remember it was updated this week. Though I would like to hear @Triforce1 's reply about this issue.

alexhulbert commented 10 years ago

Is there any easy way to easily upgrade Heroku? Its being a huge pain in the ass right now :/.

scouttyg commented 10 years ago

Upgrade heroku in what way? Just push the latest kandan release to heroku?

alexhulbert commented 10 years ago

Sorry, that was a typo. I meant upgrade with heroku. So I just need to do git pull and git push heroku master? I thought there was something extra involved? Like a migration of some sort?

scouttyg commented 10 years ago

Do a git pull, then check your git logs to make sure you have all the changes (latest hash should be 366baf2f330e171db9c52326b956dc460e5aca29).

Then just do git push heroku master, and heroku run rake db:migrate. That should be what you do under most circumstances.

alexhulbert commented 10 years ago

Wow! That was a lot easier than I thought! Also, I checked my notification area and noticed that you whipped through a whole bunch of issues in around an hour. That's awesome :D. I can't wait to update.