In regular local Roblox studio testing MessagingService:SubscribeAsync()
doesn’t function like in live servers, but using it doesn’t halt the running coroutine. However in Team Testing it seems like calling MessagingService:SubscribeAsync()
will halt the running coroutine completely without any warning or thrown error.
This was found in this block of code:
print("Subscribe start") -- Runs!
local last_roblox_message = 0
profile.roblox_message_subscription = MessagingService:SubscribeAsync("PS_" .. unique_session_id, function(message)
if type(message.Data) == "table" and message.Data.LoadCount == profile.SessionLoadCount then
-- High reaction rate, based on numPlayers × 10 DataStore budget as of writing
if os.clock() - last_roblox_message > 6 then
last_roblox_message = os.clock()
if profile:IsActive() == true then
if message.Data.EndSession == true then
SaveProfileAsync(profile, true, false, "External")
else
profile:Save()
end
end
end
end
end)
print("Subscribe end") -- Never runs in Team Test
I would expect MessagingService:SubscribeAsync()
to have consistent behaviour in local studio testing and team testing where it would not halt.