tinode / chat

Instant messaging platform. Backend in Go. Clients: Swift iOS, Java Android, JS webapp, scriptable command line; chatbots
GNU General Public License v3.0
12.06k stars 1.88k forks source link

[acc] [cred] Cannot create a subscription with newly created user #75

Closed ghost closed 6 years ago

ghost commented 6 years ago

Firstly, I am very impressed by this system and I appreciate all the effort you put into it!

I'm trying to simply create a user through websockets. I'll list all the messages I send and receive.

[hi]

{
  "hi": {
    "ver": "0.14"
  }
}

[acc]

{
  "acc": {
    "scheme":"basic",
    "user": "new",
    "secret":"dGVzdDp1c2Vy",
    "tags": ["Test User"],
    "desc":{
      "public":{
        "fn":"Test User"
      }
    },
    "cred": [{"meth":"email","val":"email@email.com", "resp":"123456"
    }]
  }
}

However after doing this it seems that while the user is created, I simply get a 500 internal server error when trying to create a new p2p message subscription from a default user (alice) to the newly created test user.

{
   "sub": {
        "topic": "<created users id ie: usrhHVAzk9Owww>",
        "get": {
            "what": "desc sub data"
        }
    }
}

response:

ctrl: {topic: "usrhHVAzk9Owww", code: 500, text: "internal error", ts: "2018-04-16T05:57:23.462Z"}

I am using docker, and the MySQL extension.

If you need any more information let me know!

or-else commented 6 years ago

Hi, thanks for the report.

I can't reproduce it though. There was such a bug but was fixed a couple of commits ago. Please make sure you are using the latest master or devel branch.

or-else commented 6 years ago

This is the commit which fixed the bug you reported: https://github.com/tinode/chat/commit/a6d578cc39d64ee9adf82cf6412b9003d1ee2c09

ghost commented 6 years ago

Ah I see. My docker version of the server does not update when you update the respository. I second #74 to have a singular image that is updated when you update the repository. I'll close this issue for you.