spawn cancellation bug

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Verse

Summary

Here we have a spawned task that cancels.
I know why it cancels, but it definitely shouldn’t.

Steps to Reproduce

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }


hello_world_device := class(creative_device):
    CancelEvent: event() = event(){}
    OnBegin<override>()<suspends>: void =
        race:
            CancelEvent.Await()
            block:
                Sleep(0.0)
                spawn. AsyncFunc()

    AsyncFunc()<suspends>: void =
        Print("Async1 Spawned")
        spawn. AsyncFunc2()
        CancelEvent.Signal()
        Sleep(0.0)
        Print("Async1 Done")

    AsyncFunc2()<suspends>: void =
        Print("Async2 Spawned")
        CancelEvent.Signal()
        Sleep(0.0)
        Print("Async2 Done")

Expected Result

Output:

LogVerse: : Async1 Spawned
LogVerse: : Async2 Spawned
LogVerse: : Async1 Done
LogVerse: : Async2 Done

Observed Result

Output:

LogVerse: : Async1 Spawned
LogVerse: : Async2 Spawned
LogVerse: : Async2 Done

So Async1 was cancelled, even tho it should have been decoupled of the initial context.

Platform(s)

All

FORT-891008 has been added to our ‘To Do’ list. Someone’s been assigned this task.