Rocket.Chat.Apps-engine icon indicating copy to clipboard operation
Rocket.Chat.Apps-engine copied to clipboard

IInternalBridge using Fibers

Open ggazzo opened this issue 5 years ago • 3 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

ggazzo avatar Mar 18 '20 13:03 ggazzo

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?

shiqimei avatar Mar 27 '20 06:03 shiqimei

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 avatar Mar 31 '20 05:03 ggazzo

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

d-gubert avatar Apr 03 '20 03:04 d-gubert