RocketChat / Rocket.Chat.js.SDK

Utility for apps and bots to interact with Rocket.Chat via DDP and/or API
MIT License
136 stars 94 forks source link

SDK (0.2.9-2) reactToMessages break in RocketChat 3.8.0 #122

Open felipetomm opened 3 years ago

felipetomm commented 3 years ago

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

mose commented 3 years ago

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

felipetomm commented 3 years ago

@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.

ataraxus commented 3 years ago

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

felipetomm commented 3 years ago

@ataraxus , our RC has updated from 3.8.0 to 3.8.1 and the problem persist.

mose commented 3 years ago

@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.

benwick commented 3 years ago

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

suranc commented 3 years ago

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.

benwick commented 3 years ago

@suranc Nice. But it seems that nobody cares for the SDK or our bots for automation... 😢

ataraxus commented 3 years ago

yes this is quite a bummer, breaking a lot of users software and now workable way out ...

suranc commented 3 years ago

Yeah seems like the contributions are getting ignored @benwick. Hopefully we can get something merged, but it feels like there's enough users to justify a fork if this repo itself is truly dead.

timkinnane commented 3 years ago

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.

benwick commented 3 years ago

Then they should close this project... But it is still here and officially documented. The most important issue now is a working npm package for integration. Is a community fork helping with this?

timkinnane commented 3 years ago

A lot of the documentation is open source. It's there because it was contributed by the community. 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.

I'm not making a judgement on that, but trying to give some context so people here don't wait around and expect a resolution that might not ever happen. If someone can fork and publish a new package to npm, that would be great. If you don't have that capacity but you have commercial interest in it being done, I'd suggest posting a bounty or offering commission to open source devs on the Rocket.Chat forum.

suranc commented 3 years ago

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.

benwick commented 3 years ago

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

ataraxus commented 3 years ago

@suranc count me in, i'll try to support you guys. Either we get this fixed or we need to switch to mattermost.... always sad to see projects to abandon community which helped for free

Sing-Li commented 3 years ago

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 :wave: 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.

benwick commented 3 years ago

Well @tiagopaixao, somebody needs to merge #127 and release a new version and npm package - to get all our precious bots working again.

tiagopaixao commented 3 years ago

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

suranc commented 3 years ago

@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.

ggazzo commented 3 years ago

hi guys, there is no good explanation for this kind of problem, sorry, the truth is that we started a development in another branch, and we deal with it as an experimental, but we are using it has been a few years (but we never merged to master to not disturb you). We have plans to combine everything we have learned and finally release an official version 1.0. We would love to use the sdk together with the web client, so in fact we would guarantee a continued support, for the time being we still have some priority issues.

it hurts me to believe that it would be better to maintain a side project than an official one, maybe we had our disagreements along the way, i would prefer to resume alignment and have more healthy libraries (we started doing this in the fuselage package)

I promise i will review and merger the PRS that guarantee compatibility with the latest versions. But I'll tell you in advance: some things were deprecated/disabled (we didn't inform the bots anymore for channels don't belong and few more other details ... I know this is not ideal, but it brought us a more performance)...

the new SDK aims (at least until now) to give greater support to chat clients (like web/mobile/livechat), for bots we strongly suggest to use apps ecosystem.

ataraxus commented 3 years ago

I dont get what you are trying to say? What I am understanding that there will be no fix for this issue?

benwick commented 3 years ago

Same here. Is it discouraged to implement a chat bot with this SDK? Is it possible to implement a chat bot with the app API? I think there should be some clear answers.

ggazzo commented 3 years ago

sorry, trying to be more direct: we will accept and launch the proper fix for this problem and for other things related to bugs (BUT this does not mean that this behavior will be valid for all occasions) we have no plans for a development focused on bots ( not so far).

Today the most robust and encouraged way is via apps.

ggazzo commented 3 years ago

ps: everything I have written so far is the current state, but there is nothing written in stone, we will raise and discuss the current situation, and try to promote a better outcome.

ggazzo commented 3 years ago

@benwick me as a developer (not as a rocket.chat developer) knowing platform limitations and possibilities/resources, I would suggest you to use the app platform.

Is it discouraged to implement a chat bot with this SDK?

benwick commented 3 years ago

@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.

suranc commented 3 years ago

@tiagopaixao do you have any update and timeframe around this? This is still blocking a very large amount of people.

tiagopaixao commented 3 years ago

Hi! @ggazzo can you help us?

benwick commented 3 years ago

I thought the critical and breaking character of this bug was clear enough. I think, a temporary and working npm module should be on the table again, if the rocket.chat devs are not able or willing to release a fix...

benwick commented 3 years ago

On a broader note: to deploy your bot with a Rocket.Chat app is a very limited experience. You even can't use npm packages... See this issue. As long as this limitation persists I don't see the app engine as a real alternative to the SDK. Please consider this when planning the future of this repo...

suranc commented 3 years ago

@benwick I agree, going down the community fork road is looking like the most viable again. I realize that @Sing-Li promises greater support around this, and a community fork is not ideal, but nothing seems to have changed. Thankfully we can simply hold back on updating Rocket.Chat as we're not already on the breaking version, but if we're compelled to update Rocket.Chat before this is fixed it would completely break all of our ChatOps. The app platform is not robust enough for our us as an alternative either.

Before we go down that road, is there really no timeline around getting this fix (PR #127) merged and a new module published to npm @tiagopaixao and @ggazzo ?