Commit 781c9eb
fix(agents-server): close the same wake-registration gap at cron & webhook-source sites
upsertCronSchedule and upsertWebhookSourceSubscription used the same
unregister-then-register sequence that dropped wakes on parallel sub-agent
spawn: the manifest-anchored wake registration is briefly absent from the
in-memory cache across the register()'s DB round-trip, so a cron tick or webhook
event arriving in that window would be missed. These are single API calls rather
than concurrent bursts, so the race is far narrower than the spawn path, but the
gap is the same class of bug — and both also race against the manifest-sync
reconcile triggered by their own writeManifestEntry.
Route both through WakeRegistry.reconcileManifestRegistration, which registers
the desired reg first (never leaving the cache empty) and then prunes only stale
rows for the manifest key. Delete-only sites (deleteSchedule,
deleteWebhookSourceSubscription, deletePgSyncObservation, upsertFutureSendSchedule)
have no re-register and so no gap; left as-is. Cron/webhook/manifest suites pass
(30/30).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent deb8c53 commit 781c9eb
1 file changed
Lines changed: 32 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2977 | 2977 | | |
2978 | 2978 | | |
2979 | 2979 | | |
2980 | | - | |
| 2980 | + | |
| 2981 | + | |
| 2982 | + | |
| 2983 | + | |
| 2984 | + | |
2981 | 2985 | | |
2982 | 2986 | | |
| 2987 | + | |
| 2988 | + | |
| 2989 | + | |
| 2990 | + | |
| 2991 | + | |
| 2992 | + | |
| 2993 | + | |
| 2994 | + | |
| 2995 | + | |
| 2996 | + | |
| 2997 | + | |
2983 | 2998 | | |
2984 | 2999 | | |
2985 | | - | |
2986 | | - | |
2987 | | - | |
2988 | | - | |
2989 | | - | |
2990 | | - | |
2991 | | - | |
2992 | | - | |
2993 | | - | |
2994 | | - | |
2995 | | - | |
2996 | | - | |
2997 | 3000 | | |
2998 | 3001 | | |
2999 | 3002 | | |
| |||
3162 | 3165 | | |
3163 | 3166 | | |
3164 | 3167 | | |
3165 | | - | |
3166 | | - | |
| 3168 | + | |
| 3169 | + | |
| 3170 | + | |
| 3171 | + | |
| 3172 | + | |
3167 | 3173 | | |
3168 | 3174 | | |
| 3175 | + | |
| 3176 | + | |
| 3177 | + | |
| 3178 | + | |
| 3179 | + | |
| 3180 | + | |
| 3181 | + | |
| 3182 | + | |
| 3183 | + | |
| 3184 | + | |
| 3185 | + | |
3169 | 3186 | | |
3170 | 3187 | | |
3171 | | - | |
3172 | | - | |
3173 | | - | |
3174 | | - | |
3175 | | - | |
3176 | | - | |
3177 | | - | |
3178 | | - | |
3179 | | - | |
3180 | | - | |
3181 | | - | |
3182 | | - | |
3183 | 3188 | | |
3184 | 3189 | | |
3185 | 3190 | | |
| |||
0 commit comments