Fixes skiptools/skip#688
I guess we could argue about whether this is the "right thing." The old LaunchedEffect would cause a Kotlin cancellation to happen when the view left the component tree. Swift task cancellation is cooperative, asking implementors to remember to call Task.isCancelled / Task.checkCancellation(); typical Kotlin APIs are not going to have the foresight to check this. Intuitively, it would be better to actually "cancel" these tasks.
IMO, it's more important to prevent the app from crashing than it is to correctly manage cancellation.
Skip Pull Request Checklist:
- REQUIRED: I have signed the Contributor Agreement
- REQUIRED: I have tested my change locally with
swift test - OPTIONAL: I have tested my change on an iOS simulator or device
- OPTIONAL: I have tested my change on an Android emulator or device
- REQUIRED: I have checked whether this change requires a corresponding update in the Skip Fuse UI repository (link related PR if applicable)
I "checked", but I can't tell, because of Skip Fuse: State not updating correctly in view under NavigationLink skip#687 - OPTIONAL: I have added an example of any UI changes in the Showcase sample app
- AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.
Cursor did this one. I tested the Skip Lite version using the Skip Lite repro. I didn't test the Skip Fuse version, because skiptools/skip#687 prevents me from even reproducing skiptools/skip#688 in the first place.