Michael-48/Iris

RemoteEvents don't function correctly when using rbxnet

zwinplayer64 opened this issue · 3 comments

Unsure whether it's my issue or not, but any request gets rejected when using Iris to send it.
Button code:

if Iris.Button({ "Button" }).clicked() then
    local remote = remotes.Client:Get("PrintMessage")
    remote:SendToServer("This should be printed")
end

Server-side code:

remotes.Server:Get("PrintMessage"):Connect(function(plr, message)
	print(message)
end)

Error itself:
net.out.definitions.ClientDefinitionBuilder:54: Expected Promise rejected with no value.
Everything works perfectly fine when using a vanilla Roblox button and the message gets printed.

Rbxnet: https://rbxnet.australis.dev/

Seems more like an rbxnet issue

I tried having a look at the documentation for RBXNet but I wasn't quite sure how it works. Within the Iris loop, there shouldn't be any asynchronous code which would prevent the entire code from finishing. I presume that would be the issue, but I'm not quite sure. I'll see if I can do some testing with this.

This appears to be intended behavior. In an Iris execution cycle, a coroutine is spawned and if its lifecycle is not concluded when the next Iris cycle is initialized, then the coroutine is ended. In most scenarios involving asynchronous code inside of an Iris cycle it is best practice to spawn a thread and keep all GUI code synchronous.