Commit 70e9f29
fix(retryFailedStep): avoid mutating shared defaultConfig
Each call to retryFailedStep mutated the module-level defaultConfig via
Object.assign(defaultConfig, config), so config.when from a prior call leaked
into the next as customWhen and chained recursively. In tests this made
when() return undefined for closures that no longer had a live step.started
listener (e.g. after event.cleanDispatcher), causing the new regression test
to fail in the full unit suite even though it passed in isolation.
Use Object.assign({}, defaultConfig, config) so each registration gets an
independent config object. Rewrites the regression test to assert via
retryConfig.when() directly, which is now sound.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent e9f4836 commit 70e9f29
2 files changed
Lines changed: 9 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
| 165 | + | |
| 166 | + | |
166 | 167 | | |
167 | | - | |
168 | 168 | | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
185 | 172 | | |
186 | | - | |
187 | | - | |
| 173 | + | |
| 174 | + | |
188 | 175 | | |
189 | 176 | | |
190 | 177 | | |
| |||
0 commit comments