Skip to content

Fix: Suspended child contexts survive after their parent ends - #375

Merged
techmahedy merged 1 commit into
doppar:4.xfrom
techmahedy:issue-4.x
Oct 17, 2026
Merged

techmahedy merged 1 commit into
doppar:4.xfrom
techmahedy:issue-4.x

Conversation

@techmahedy

Copy link
Copy Markdown
Member

Pull Request Checklist

Q A
Branch? 4.x
Bug fix? yes
New feature? no
Deprecations? no
Issues -
License MIT

Description

endContext() only ends contexts present in contextStack. A child that was suspended is removed from that stack but remains in liveContexts. Ending its parent leaves the child alive and resumable.

Reproduction:

$outer = $container->beginContext('outer');
$inner = $container->beginContext('inner');
$container->suspendContext($inner);
$container->endContext($outer);
$container->resumeContext($inner);
// The active context is unexpectedly "inner".

This PR will fix this issue

@techmahedy techmahedy added the bug Something isn't working label Oct 17, 2026
@techmahedy
techmahedy merged commit 4e2cbc6 into doppar:4.x Oct 17, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant