FIX: Incorrect behavior of .with(delay:) for ActionGroup#128
Open
killlilwinters wants to merge 6 commits into
Open
FIX: Incorrect behavior of .with(delay:) for ActionGroup#128killlilwinters wants to merge 6 commits into
killlilwinters wants to merge 6 commits into
Conversation
Maks-Jago
reviewed
Jul 1, 2026
IosifSuzuki
approved these changes
Jul 1, 2026
Maks-Jago
reviewed
Jul 1, 2026
|
|
||
| var actions: [LoggingAction] { | ||
| lock.withLock { $0 } | ||
| } |
Owner
There was a problem hiding this comment.
нащо lock? ми ж в кожному тесті створюємо свій екземпляр ActionCollectorLogger
Collaborator
Author
There was a problem hiding this comment.
В принципі якщо його прибрати то тести фейлитись не будуть але так як у нас тут EnvStore потік та потік наших тестів одночасно оперують над масивом то теоретично може бути race, ThreadSanitizer на це скаржився.
WARNING: ThreadSanitizer: Swift access race (pid=49329)
Modifying access of Swift variable at 0x00010e9045f0 by thread T4:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This merge request fixes metadata loss when decorating nested
ActionGroups. Previously, applying modifiers such as.with(animation:),.with(delay:),.silent(), or.binded(...)to a group only mapped the top-level internal actions. If a child action inside that group was itself wrapped in anotherActionGroup, the modifier could be applied incorrectly to the wrapper or flatten the structure in a way that dropped child-level behavior.The change is necessary because delayed and animated actions can be composed together, and nested groups must preserve both parent-applied metadata and child-specific metadata. The added test demonstrates the concrete failure case: a delayed group containing a child action with animation should still execute with the delay while keeping the child animation intact.
An alternative would have been to special-case each modifier’s group handling separately, but introducing a shared recursive mapping mechanism keeps the behavior consistent across all action decorators.
Changes Made
Added a recursive traversal utility to
ActionGroup:recursiveMap(_:)walks nestedActionGroups and applies transforms only to leafInternalActions._actions.map(...).Updated action decorators in
Action.swiftto use recursive mapping for grouped actions:.with(animation:).silent().binded(...).with(delay:)Added a regression test covering nested delay + animation composition:
ActionGroupcan retain its own animation.Increased the
DelayedActionTestssuite constraints with a 1-minute time limit to better bound async timing-based test execution.ClickUp task
https://app.clickup.com/t/869dxz026