Closed jcapayne closed 6 years ago
sounds like a connectivity or authentication issue. Are you able to run a http logging proxy locally like fiddler and see the API responses?
So looking into this as i have the same problem.
It looks like the parameter 'mentionedPeople=me' is not being passed.
The exact error @jcapayne mentioned is returned from spark API when you try to list messages from a room with with "type": "room", without 'mentionedPeople=me' being passed. When you do pass it, it works.
Unfortunately we can't just always send it, because if you pass that parameter for rooms with "type": "direct", it returns 0 messages because @mentions don't work in direct rooms.
It looks to me like in /src/spark-api.coffee it's got the logic to check if you are a bot, and pass the option, but it doesn't appear to be working (or being called?). According to the error on line 23, if the check was ran against a non-bot auth token, it should fail and error out. I tried configuring hubot with my personal access token, and it happily worked not caring that i was not a bot and I was able to send messages to the bot in the group room.
We need to update this so not only is the parameter passed for the correct room type, but also be able to tell the difference in the room type, which it doesn't look like this module does.
I'm barely able to read JS/Coffee so I can't attempt to fix it without spending some time learning this language. Hopefully @tonybaloney or @selesse can help out :)
So after updating the local version of spark to 2.0 and the local version of NPM to the latest, This is working for me.
thanks @namachieli closing issue.
I can't get my hubot to receive any messages from spark. Debug logging provides:
Unhandled rejection {"message":"Failed to get activity.","errors":[{"description":"Failed to get activity."}],"trackingId":""}