Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): re-snoozing a woken thread to the same wake time hides it again #14887

MergedJonasFocus(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/14887/headmerged by juliusmarminge View on GitHub

Showing 4 changed files with 35 additions and 10 deletions (loading 1).

x
0 of 4 viewed, 4 left
5 additions and 7 deletionsapps/server/src/orchestration-v2/Orchestrator.tsModified
View file
@@ -2534,17 +2534,15 @@
case "thread.snooze": {
- const sameWakeTime =
- thread.snoozedUntil != null &&
- snoozedUntil !== null &&
- DateTime.toEpochMillis(thread.snoozedUntil) === DateTime.toEpochMillis(snoozedUntil);
- const existingSnoozedAt = sameWakeTime ? (thread.snoozedAt ?? null) : null;
+ // Always restamp, even for the same wake time: a re-snooze after a
+ // failure or completion woke the thread means "I saw it, not now".
+ // Retries are deduplicated by commandId before reaching here.
return {
...thread,
snoozedUntil,
limitRecovery: thread.limitRecovery ? { ...thread.limitRecovery, snooze: false } : null,
- snoozedAt: existingSnoozedAt ?? now,
- updatedAt: existingSnoozedAt === null ? now : thread.updatedAt,
+ snoozedAt: now,
+ updatedAt: now,
case "thread.unsnooze": {
8 additions and 3 deletionsapps/server/src/orchestration-v2/runtimeLayer.test.tsModified
View file
@@ -3367,9 +3367,11 @@
const firstProjection = yield* orchestrator.getThreadProjection(threadId);