RocketChat / Rocket.Chat.Apps-engine

The Rocket.Chat Apps engine and definitions.

Home Page:https://rocketchat.github.io/Rocket.Chat.Apps-engine/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IInternalBridge using Fibers

ggazzo opened this issue · comments

I think the getUsernamesOfRoomById definition/usage is wrong, should expect a promise, since we need an async call here, nowadays the implementation uses fibers that's why it is possible to return an Array... But I don't think we want the engine fiber dependant

Hi @ggazzo . since the getter

public get usernames(): Array<string> {
depends on this bridge method, which is not compatible with async/await. Do you have any ideas to migrate to the promise version and keep compatibility too?

hmm... I think only an await on the engine will help... it doesn't matter if the function returns a primitive or a promise...an await will wrap the return... after that fix on the rocketchat size

@ggazzo I agree with you, but I can't see a backward-compatible way to solve this. It needs to wait for v2.0 :/