[BUG] A slow Today’s Focus load can overwrite a newer goal

Abierto
#4,059 3 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@Junaid2-7777 ya está trabajando en esto.

Desde el 3/12/2026.

  • #4061 de @Junaid2-7777 — abierto

Evaluación

Este issue todavía no se ha evaluado.

Descripción

bug needs-triage status:assigned
What happened?

The Today’s Focus form remains usable while its initial GET is pending. If that request returns a previously saved goal after I save a new one, TodayFocusHero applies the older response to both the UI and localStorage. The most recent save should stay visible and survive reloads using the local cache.

Steps to reproduce
  1. In local development or a component test, delay the initial /api/daily-focus?date=… response with an existing goal; let the POST respond normally.
  2. Before the GET resolves, enter and save a different goal.
  3. Resolve the GET with the old goal. The current response handler overwrites the just-saved goal in the card and localStorage.

Found by tracing src/components/TodayFocusHero.tsx on main; no production requests made. I’d like to add a deferred-response regression test and guard against a stale read after a local change.

Where is it?

Dashboard overview

Where did you see it?

Local development

Browser and device

No response

Screenshots, console errors or logs

No response

Want to fix it?
  • I'd like to work on this. A maintainer will assign you; please don't start before that.
Lenguaje dominante
TypeScript
Estrellas
246
Forks
436
Merge medio
9 h 33 min
PR fusionados (30 d)
213

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Priyanshu-byte-coder/devtrack

Todos los issues de Priyanshu-byte-coder/devtrack

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.