fix: critical bug fixes — invoke params, download flow, stale closures#8
fix: critical bug fixes — invoke params, download flow, stale closures#8
Conversation
…, stale closures - Fix Tauri invoke parameter names: system_prompt→systemPrompt, max_tokens→maxTokens (CRITICAL: without this fix, AI receives no system prompt and generates garbage) - Fix model download already-exists path: invoke resolves without download-complete event, causing isDownloading stuck true forever and sidecar never starting - Fix deploy_config type: DB stores JSON string, not object. Added updateDeployConfig store action so subsequent deploys reuse existing site instead of creating new one - Fix PreviewFrame WYSIWYG stale closure: use ref for currentProject so rapid edits don't overwrite each other - Fix shared unlistenRef leak in useAiStream: each call uses its own cleanup reference - Reset initialPromptSent, chat messages, and editor selection on project navigation - Add try/catch to loadProjectById to prevent permanent loading state on errors Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
WalkthroughThis PR refactors deployment configuration handling to store Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Fixes 8 bugs found during code review:
system_prompt/max_tokensin snake_case but Tauri expects camelCase from JS. AI was receiving no system prompt — all generation was broken.isDownloadingstucktrueforever, sidecar never auto-startsdeploy_configtyped as object but DB returns JSON string. Store never updated after deploy, causing duplicate site creation on redeploycurrentProjectclosure — rapid edits overwrote each otherunlistenRefin useAiStream leaked on concurrent generate/generateSection callsinitialPromptSentref never reset on project navigation, blocking auto-prompt for subsequent template projectsloadProjectByIdhad no try/catch — exceptions leftloading: truepermanentlyTest plan
npx tsc --noEmit)npm run build)🤖 Generated with Claude Code
Summary by CodeRabbit