Skip to content

Commit 41e3f33

Browse files
t3dotggclaude
andcommitted
fix(web): never carry draft content onto an invested destination
Guards a racing repo change from overwriting a prompt an earlier carry already moved in. Review finding from macroscope. Co-Authored-By: Claude Fable 5 <[email protected]>
1 parent 0276a4c commit 41e3f33

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎apps/web/src/hooks/useHandleNewThread.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ export function useNewThreadHandler() {
147147
if (
148148
carryContentSourceDraftId &&
149149
carryContentSourceDraftId !== destinationDraftId &&
150+
// Never clobber a destination the user already invested in — the
151+
// move overwrites the destination prompt, so a concurrent repo
152+
// change that carried content first must win.
153+
!composerDraftHasUserContent(getComposerDraft(destinationDraftId)) &&
150154
composerDraftHasUserContent(getComposerDraft(carryContentSourceDraftId))
151155
) {
152156
moveComposerPromptAndImages(carryContentSourceDraftId, destinationDraftId);

0 commit comments

Comments
 (0)