Commit 3766582
authored
fix(webhooks): run inactive deployment-version cleanup inline on deploy (#5250)
When a deploy activates a new version, superseded versions' webhooks are
removed by a separate, best-effort CLEANUP_INACTIVE outbox event. When that
event is lost/dead-letters, old-version webhooks linger as is_active orphans
that fetchActiveWebhooks skips (version mismatch), so they silently stop
polling (~515 webhooks across ~130 workflows in prod).
Run the existing cleanupInactiveDeploymentVersions synchronously in the
SYNC_ACTIVE handler, right after the active version's webhooks/schedules are
registered, falling back to the deferred outbox event only if the inline pass
throws. This reuses the existing guarded cleanup, which re-checks each version
is still inactive before tearing anything down (so it never touches the active
version) and runs strictly after registration (so a teardown failure can't
block it).1 parent 3e03f8c commit 3766582
1 file changed
Lines changed: 36 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
| 210 | + | |
211 | 211 | | |
212 | 212 | | |
| 213 | + | |
213 | 214 | | |
214 | 215 | | |
215 | 216 | | |
| |||
278 | 279 | | |
279 | 280 | | |
280 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
281 | 316 | | |
282 | 317 | | |
283 | 318 | | |
| |||
0 commit comments