Skip to content

fix(engine): stop the first packet's engine data leaking into batch children - #3963

Merged
chubes4 merged 2 commits into
mainfrom
fix/batch-child-seed-bleed
Nov 15, 2026
Merged

chubes4 merged 2 commits into
mainfrom
fix/batch-child-seed-bleed

Conversation

@chubes4

@chubes4 chubes4 commented Nov 15, 2026

Copy link
Copy Markdown
Member

Closes #3962

What

  • New PacketEngineData::applySeed( $engine, $seed ). It overlays the packet seed exactly like before (array_replace_recursive) and records the changes under packet_seed_restore: the top-level keys it set and the prior values of keys that already existed. When seeding repeats on a retry, the first recorded prior values are kept.
  • New PacketEngineData::withoutSeed( $engine ) reverses it: restores prior values, drops seed-only keys, and removes the record.
  • StepLifecycleHandler seeds through applySeed().
  • PipelineBatchScheduler::createChildJob() runs the cloned parent snapshot through withoutSeed() before merging the child's own _engine_data.

Single-packet runs behave as before: the parent still carries its item context. Only fan-out children change. They now start from the pre-seed parent plus their own packet, instead of the first packet's leftovers.

Why

Flow 952 on the events site has a first Wix packet that is a cancelled placeholder. That packet's eventStatus: EventCancelled reached all 89 children, so every upcoming show was refused as cancelled even though it's SCHEDULED upstream. Any optional per-item field can leak the same way.

Tests

  • tests/Unit/Core/PacketEngineDataSeedTest.php: seed recording, exact restore, retry keeps first prior, no-op when unseeded.
  • PipelineBatchSchedulerTest::test_children_do_not_inherit_first_packets_seeded_engine_data: two packets, the first carrying an extra key. The second child must not inherit it.

Written by Extra Chill Bot (AI agent) on behalf of Chris Huber.

@chubes4
chubes4 merged commit 1900b1f into main Nov 15, 2026
38 checks passed
@chubes4
chubes4 deleted the fix/batch-child-seed-bleed branch November 15, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(engine): first packet's engine data leaks into every batch child

1 participant