Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/backend/src/swarm/session/conversation-projector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ export class ConversationProjector {
if (existing.controlCommandId !== control.commandId || existing.controlInputHash !== control.contentHash) {
throw Object.assign(new Error("Canonical input ID has conflicting content."), { code: "CONFLICT", retryable: false });
}
const fd = openSync(descriptor.sessionFile, "r");
const fd = openSync(descriptor.sessionFile, "r+");
try { fsyncSync(fd); } finally { closeSync(fd); }
return existing;
}
Expand All @@ -380,7 +380,7 @@ export class ConversationProjector {
if (!persisted || persisted.controlInputHash !== control.contentHash) {
throw new Error("Canonical writer did not persist the controlled input.");
}
const fd = openSync(descriptor.sessionFile, "r");
const fd = openSync(descriptor.sessionFile, "r+");
try { fsyncSync(fd); } finally { closeSync(fd); }
const source = statSync(descriptor.sessionFile);
control.onLocator?.({ fileGeneration: `${source.dev}:${source.ino}`, byteOffset: offset, entryId: persisted.timelineEntryId ?? persisted.id! });
Expand Down
Loading