Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): deleted threads release their stored history #32378

Closedrealhasanshoaib(GitHub profile, opens in a new tab)wants to merge 8 commits intomain fromrefs/pull/32378/headopened View on GitHub

Showing 5 changed files with 216 additions and 1 deletion (loading 3).

x
0 of 5 viewed, 5 left
1 addition and 0 deletionsapps/server/src/orchestration-v2/Orchestrator.tsModified
View file
@@ -6021,6 +6021,7 @@
// Read under the source's lock; validate the modes copied here, not an earlier read.
yield* refuseAboveDispatchModeLimit(command, command.sourceThreadId, sourceProjection.thread);
+ // Deleted threads lose their content once purged, so nothing may start depending on one.
if (sourceProjection.thread.deletedAt !== null) {
return yield* new OrchestratorDispatchError({
commandId: command.commandId,
215 additions and 1 deletionapps/server/src/orchestration-v2/ProjectionMaintenance.test.tsModified
View file
@@ -6,7 +6,9 @@
type OrchestrationV2AppThread,
type OrchestrationV2DomainEvent,
type OrchestrationV2TurnItem,
+ MessageId,
ProjectId,
+ RunId,
ProviderDriverKind,
ProviderInstanceId,
ThreadId,
@@ -94,8 +96,8 @@
spec: (typeof itemSpecs)[number],
revision: number,
eventId = `event:turn-item-compaction:${spec.key}:${revision}`,
+ id = TurnItemId.make(`turn-item:compaction:${spec.key}`),
): OrchestrationV2DomainEvent {
- const id = TurnItemId.make(`turn-item:compaction:${spec.key}`);