Rocket.Chat.Apps-engine
Rocket.Chat.Apps-engine copied to clipboard
IInternalBridge using Fibers
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 https://github.com/RocketChat/Rocket.Chat.Apps-engine/blob/e9ca98a44423510ae1e91b519e8014ba214ad515/src/server/rooms/Room.ts#L24 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 :/