fix(server): a thread with an unknown event type can still be resynced after a downgrade #14206
Closedshivamhwp(GitHub profile, opens in a new tab)wants to merge 250+ commits into
main fromfix/server-replay-skips-unknown-eventsopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- apps/server/src/persistence/Layers/OrchestrationEventStore.ts line 440OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -424,5 +425,16 @@424425 );425426 },426427 ).pipe(427- Stream.mapEffect((row) =>428- rowToV2StoredEvent(row).pipe(428+ Stream.mapEffect((row) => {429+ // Only this opt-in replay path tolerates a row whose event_type this430+ // build does not recognize (e.g. after a downgrade past a row an431+ // older build never learned). Every other reader of this store stays432+ // strict: a known type whose payload fails to decode is still a real433+ // bug and must still fail.434+ if (435+ input?.skipUnknownEventTypes === true &&436+ !isKnownOrchestrationV2EventType(row.event_type)437+ ) {438+ return Effect.logWarning(439+ "Skipping a replayed application event row with a type this build does not know",440+ { threadId: row.stream_id, sequence: row.sequence, eventType: row.event_type },
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:M
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
juliusmarminge added labelsmacroscope-review
shivamhwp(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed