mirror of
https://github.com/stablyai/orca.git
synced 2026-10-12 16:03:03 +00:00
fix: address pr-bug-scan findings from #1466
Cleared selectedRepoSlug synchronously at the top of the resolution effect so a repo switch invalidates the prior slug until the new IPC call resolves, preventing cross-repo PR mislinks during the in-
This commit is contained in:
@@ -378,8 +378,13 @@ export function useComposerState(options: UseComposerStateOptions): UseComposerS
|
||||
)
|
||||
const selectedRepoPath = selectedRepo?.path
|
||||
useEffect(() => {
|
||||
// Why: clear synchronously on every change so a repo switch (path A → B)
|
||||
// invalidates the prior slug until the new IPC call resolves. Without
|
||||
// this, effectiveLinkedPR would accept a PR URL whose slug matches the
|
||||
// previous repo during the in-flight window — exactly the cross-repo
|
||||
// mislink the slug guard is meant to prevent.
|
||||
setSelectedRepoSlug(null)
|
||||
if (!selectedRepoPath) {
|
||||
setSelectedRepoSlug(null)
|
||||
return
|
||||
}
|
||||
let cancelled = false
|
||||
|
||||
Reference in New Issue
Block a user