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

Open
#4,059 3 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@Junaid2-7777 is already working on this.

Since Dec 3, 2026.

  • #4061 by @Junaid2-7777 — open

Assessment

This issue has not been assessed yet.

Description

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.
Dominant language
TypeScript
Stars
246
Forks
436
Avg merge
9h 33m
Merged PRs (30d)
213

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Priyanshu-byte-coder/devtrack

All issues in Priyanshu-byte-coder/devtrack

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.