Rocket.Chat.js.SDK: SDK (0.2.9-2) reactToMessages break in RocketChat 3.8.0

SDK Version: 0.2.9-2

As related in RocketChat repo, that issues 19566, 19567 and 19433, the last stable version of RocketChat (3.8.0), has break the SDK. Two points are related above. Firstly, the message param of reactToMessages has changed from Object to Array. This cause an exception: image And, the second point is the message of undefined value in room. This point has logged in the first line of this print ^.

A propose resolution:
For first point, add this line in driver.js (line 351):

message = Array.isArray(message) ? message[0] : message;

Like this, at line 358:
image

For second point, add an new access to args. image

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 12
  • Comments: 32 (7 by maintainers)

Commits related to this issue

Most upvoted comments

@felipetomm : Make the PR, we can nag @timkinnane and @Sing-Li on bbot channel on rocket.chat rocketchat and even discuss about the future of this repo.

So, rocket.chat doesnt revert their breaking change? and everybody has to somehow patch their infrastructure?

I submitted #127 which resolves this issue. It contains @benwick’s fix, a fix to reactToMessages as well as a build of the new version.

@ggazzo as a developer, I try to automate many things. To have the bot code and the server for various automation requests in the same place and repo makes my live easy. With an app most of these things wouldn’t work out.

Hi @benwick! I’ll put this in my next meeting agenda! Just after that, I’ll make you know. Tks for your contribution.

The core team don’t have the resources to maintain or respond to every contribution or join every conversation and in my experience they’ll avoid getting involved if it’s not related to features in their next release.

@timkinnane Great to see you in action again! Welcome back 👋 Rocket.Chat has grown and changed a lot since we last met and worked together. And while what you described might have been the case for the past number of years, it is about to change completely.

@suranc @benwick and @ataraxus there is no need to incur the extra overhead of a remote fork which will have to be kept synchronized with core anyways. Please rest assured that there has never been an intention to abandon this very important project.

Let me introduce you to @tiagopaixao - he has joined us in IT governance, and will have direct influence over project governance / management, core team resource allocation, and our ongoing collaboration with community right here. Please work with Tiago to make the JS SDK project work for you.

Thanks again for all your support.

I think a working npm package is the most important important issue right now.

I’d be willing to add people as collaborators to my fork at https://github.com/suranc/Rocket.Chat.js.SDK, or create a new GitHub organization for the purpose even. In the meantime I can work on getting a build of my fix published to npm since it seems not having that is pretty universally the biggest blocker for people.

Does that sound good to everyone? If so and you want to be a collaborator, let me know.

@mose , i can make. But, i think that repo are “non official” discontinued. Because of this, i need urgently apply that fix in a fork of SDK and publish them to npm.

@Sing-Li glad to hear that maintenance will resume on this SDK project! I would definitely prefer to not have to maintain a fork, and it’s better for the code to exist close to the project and in the same GitHub organization.

@tiagopaixao nice to meet you! Looking forward to hear the outcomes of your meeting, but especially looking forward to getting a working fix (PR #127 or equivalent) merged and new npm package deployed. I know personally, for our use case this also breaks the 2.0.0 version of the hubot-rocketchat connector, and I will be anticipating/contributing a fix there as well once a fixed npm package of the SDK is deployed to npm.

Hello - I’m the original creator of the SDK. Unfortunately not here to offer a solution, but to encourage the idea of a community fork. AFAIK the Rocket.Chat team’s objectives for the SDK are more around livechat agent support than custom bots, so it’s hard to get or coordinate support - which is partly the reason I stopped working on it (two years ago).

If you have a resolution for the issue and are interested in maintaining this and engaging with the RC bot community, I think a community fork would be awesome and allow it to continue as a pure utility for RC-bot integration.

So, the SKD is practically dead with new versions of Rocket.Chat server? 😦

Tested it and it works great. Are you going to make it a PR?