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

Aperta
#4,059 3 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Junaid2-7777 ci sta già lavorando.

Dal 3/12/2026.

  • #4061 di @Junaid2-7777 — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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.
Lingua principale
TypeScript
Stelle
246
Fork
436
Merge medio
9h 33m
PR unite (30g)
213

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Priyanshu-byte-coder/devtrack

Tutte le issue di Priyanshu-byte-coder/devtrack

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.