From fc2ffd8c23d8a6d056afb9d573b3cc62c4f3c12e Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Mon, 9 Jun 2025 16:25:27 -0400 Subject: [PATCH] Revert "[skip ci][perf] do not listen on tasks that have no callbacks" (#647) * Revert "[skip ci][perf] do not listen on tasks that have no callbacks" This reverts commit 0bc5ab6117bfdfdf5f916455490d4a6be6d04702. * changelog --- CHANGELOG.md | 4 +++- playlet-lib/src/source/AsyncTask/AsyncTask.bs | 10 ++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f93669a..b4a80059 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -- Nothing worth mentioning yet. +### Fixed + +- [Perf] reverted a perf fix that wasn't helping ## [0.40.1] - 2025-06-07 diff --git a/playlet-lib/src/source/AsyncTask/AsyncTask.bs b/playlet-lib/src/source/AsyncTask/AsyncTask.bs index 7e07ca3e..dd8d48fd 100644 --- a/playlet-lib/src/source/AsyncTask/AsyncTask.bs +++ b/playlet-lib/src/source/AsyncTask/AsyncTask.bs @@ -14,10 +14,9 @@ namespace AsyncTask task.id = id task.input = input - if callback <> invalid - m[`asynctask_${id}_callback`] = callback - task.ObserveFieldScoped("state", FuncName(internal_OnTaskState)) - end if + m[`asynctask_${id}`] = task + m[`asynctask_${id}_callback`] = callback + task.ObserveFieldScoped("state", FuncName(internal_OnTaskState)) return task end function @@ -40,6 +39,9 @@ namespace AsyncTask end if end if + task.input = invalid + task.output = invalid + m.delete(`asynctask_${id}`) m.delete(`asynctask_${id}_callback`) end function