feat(use-apply): pre-generate commit msg before activation - #628
feat(use-apply): pre-generate commit msg before activation#628cooper (czxtm) wants to merge 1 commit into
Conversation
Fire generateCommitMessage() as an unawaited side effect at the start of handleApply — the diff is final before activation starts, and the save panel can regenerate on failure. An inference failure must not block or delay activation. Merge-section's existing effect must not clobber the in-flight suggestion: short-circuit when commitMessageSuggestion is already set.
🎨 Storybook previewUpdated for e317587
|
There was a problem hiding this comment.
Warning
apps/native/src/components/widget/layout/merge-section.tsx (line 32) [behavior_change]: Adding commitMessageSuggestion to the useEffect dependency array creates a duplicate-request loop during regeneration. generateCommitMessage() uses clear: true by default (use-summary.ts line 18), which synchronously sets the suggestion to null; that null triggers the effect again (short-circuit on line 26 does not fire for falsy values), launching a second concurrent network call alongside the one already started by handleRegenerate. Pre-PR, clicking Regenerate fired exactly one call; post-PR it fires two concurrent calls on every regeneration, with the last-response-wins outcome being silent and untested.
📋 PR Overview
🔬 Coverage
|
Juanpe Bolívar (arximboldi)
left a comment
There was a problem hiding this comment.
LGTM!

Fire generateCommitMessage() as an unawaited side effect at the start of
handleApply — the diff is final before activation starts, and the save
panel can regenerate on failure. An inference failure must not block or
delay activation.
Merge-section's existing effect must not clobber the in-flight
suggestion: short-circuit when commitMessageSuggestion is already set.