Calling task.wait() with nan or inf as an argument results in a warning saying task.delay instead of task.wait

this isn’t a serious bug

using task.wait(0/0) or task.wait(1/0) results in this error msg

Calling task.delay(t, f) where t is either NaN or infinite will cause f to be called with a timeout of 0.

Expected behavior

the error msg should be something similar to this
Calling task.wait(t) where t is either NaN or infinite will cause task.wait() to not wait

8 Likes

These mean the same things though? A timeout of 0 is the same as not waiting, however, the wait function is still being applied, so I think your error suggestion might be more confusing.

It’s not the same as not waiting, without task.wait (actual NO waiting) you can get stack overflow (while true do end), where task.wait() still yields until next heartbeat

1 Like

also the error is correct and displays what it needs to

what I mean is that
the used function is task.wait() which takes 1 input as an argument
the outputted function in the console is task.delay() which isnot the same as task.wait()

the error aplies to both task.wait and task.delay they just probably forgot to display it

and that is why I made a bug report

something that isn’t behaving as intended, like this

2 Likes

you cannot even define it, i’m not even sure you know what “behavior” means. The correct behavior is to use timeout of 0 if NaN or INF is given and that’s exactly what it does, you are only whining about what the error displays, that’s not a bug

if you don’t know task.delay() and task.wait() are two different functions and each one of them does a different thing

task.wait() doesnot wait to execute function f instead it yields until the time is reached
and I said that this isn’t a serious bug but it’s still a bug

I’m confused. Are you using task.wait() or task.delay()?

am using task.wait but the error msg says task.delay for some reason

1 Like

How are you writing it? task.wait() should consist of 1 number unless you want it to randomize in which case that is task.wait(math.random(small num, high num))

I said that in the topic

am writing it with nan or infinite task.wait(0/0) or task.wait(1/0)

I’m mostly confused by why you would want to do that?

I don’t want to do that but that may happen unexpectedly like if a client sent an inf value to the server and the server did task.wait(num) while num is inf then the error msg will say task.delay() while the used function is task.wait() that may seem fine but can be confusing in some cases I don’t really care if this didn’t get fixed but the error msg is unexpected so I did report it

2 Likes

While there are workarounds to resolve issues like this if you see it pop-up. The origional poster is not in the wrong since he is just pointing out that the warning is incorrectly worded which can be misleading to finding and resolving the issue and you could run into this issue when you are sending data via remote events and functions.

You should also not continuiously harras the original poster as they are not wrong to submit this bug report and also breaks DevForum TOS as a heads up and to also bring to light why he made this bug report

Typically that’s not how it works. A Roblox Developer Engagement/Relations member will check it within 24 to 48 hours depending on waiting times and verify if it should be flagged to engineers or if it’s developer error

The confusion is that it is calling it a task.delay rather then the task.wait that it is which can be perfectly reasonable for someone to mistake and be confused by as thats the incorrect fuction.

Correct me if I’m wrong but I’m pretty sure task.wait(t) just calls task.delay(t,f) where f is the current thread.

I do think the error should be changed for task.wait() though to be something like:

Calling task.wait(t) where t is either NaN or infinite will cause the current thread to have a timeout of 0.

1 Like