sourceRef.current in useMemo may produce stale matchedTemplate
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 55/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Calme
- Stack technique
- typescript
- Domaine
- frontend
Piste de recherche
Start in apps/app/src/components/generative-ui/save-template-overlay.tsx and inspect the matchedTemplate useMemo, its dependency array, and how sourceRef.current is set in the apply flow. Choose a reactive source-template representation, then verify that the matched template badge updates when the source ref changes after the last html or templates change.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Problem
In save-template-overlay.tsx, the matchedTemplate useMemo reads sourceRef.current to find the source template from the apply flow. However, React refs don't trigger re-renders when they change, so the memo's dependency array ([html, agent.state?.templates]) won't capture changes to sourceRef.current.
In practice this works because html or templates changes trigger recomputation, but it's technically not guaranteed — if the ref is set after the last html/templates change, the matched template badge could show stale data.
Suggested fix
Either:
- Store the source template info in state instead of a ref (triggers re-render on change)
- Add the source ID as an explicit dependency by extracting it to a state variable
Files
apps/app/src/components/generative-ui/save-template-overlay.tsx
From PR #20 review
- Langage dominant
- TypeScript
- Étoiles
- 3.9k
- Forks
- 414
- Merge moyen
- 4 h
- PR mergées (30 j)
- 6
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de CopilotKit/OpenIntelligentUI
-
Script dedup key truncation may cause collisionsPeut-être pris @saschabuehrle l’a pris il y a 216 jours. Ouvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
CopilotKit/OpenIntelligentUI#37 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
CopilotKit/OpenIntelligentUI#29 ·
Les mainteneurs répondent en général sous 1 jour
-
Self-host with Docker Compose and optional server-held keysPeut-être pris @kannan983 l’a pris il y a 16 jours. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 18/100
CopilotKit/OpenIntelligentUI#98 ·
Les mainteneurs répondent en général sous 1 jour
-
Support OpenAI-compatible gateways (OpenRouter) via vendor/model namesPeut-être pris @kannan983 l’a pris il y a 16 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 25/100
CopilotKit/OpenIntelligentUI#97 ·
Les mainteneurs répondent en général sous 1 jour
-
UIOuverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 8/100
CopilotKit/OpenIntelligentUI#96 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de CopilotKit/OpenIntelligentUI
Issues similaires
-
支持对已取消(cancelled)任务生成报告Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
Clouditera/VulnHunter#57 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
bug bug:behavior clawsweeper:bulk-filed clawsweeper:fix-shape-clear clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:auth-provider issue-rating: 🦞 diamond lobster P2
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
openclaw/openclaw#185297 · 1 commentaire · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
-
bug needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
apex-dev-tools/apex-log-parser#199 ·
Les mainteneurs répondent en général sous 1 jour